From 469db8f9e2bdedf4aea71c5164aa6c00e95261d8 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Thu, 4 Jan 2018 23:26:04 +0200 Subject: [PATCH] make nodes fields public --- node/argument.go | 12 +++--- node/expr/array.go | 12 +++--- node/expr/array_dim_fetch.go | 22 +++++------ node/expr/array_item.go | 22 +++++------ node/expr/assign_op/assign.go | 18 ++++----- node/expr/assign_op/assign_op.go | 4 +- node/expr/assign_op/assign_ref.go | 18 ++++----- node/expr/assign_op/bitwise_and.go | 18 ++++----- node/expr/assign_op/bitwise_or.go | 18 ++++----- node/expr/assign_op/bitwise_xor.go | 18 ++++----- node/expr/assign_op/concat.go | 18 ++++----- node/expr/assign_op/div.go | 18 ++++----- node/expr/assign_op/minus.go | 18 ++++----- node/expr/assign_op/mod.go | 18 ++++----- node/expr/assign_op/mul.go | 18 ++++----- node/expr/assign_op/plus.go | 18 ++++----- node/expr/assign_op/pow.go | 18 ++++----- node/expr/assign_op/shift_left.go | 18 ++++----- node/expr/assign_op/shift_right.go | 18 ++++----- node/expr/binary_op/binary_op.go | 4 +- node/expr/binary_op/bitwise_and.go | 18 ++++----- node/expr/binary_op/bitwise_or.go | 18 ++++----- node/expr/binary_op/bitwise_xor.go | 18 ++++----- node/expr/binary_op/boolean_and.go | 18 ++++----- node/expr/binary_op/boolean_or.go | 18 ++++----- node/expr/binary_op/coalesce.go | 18 ++++----- node/expr/binary_op/concat.go | 18 ++++----- node/expr/binary_op/div.go | 18 ++++----- node/expr/binary_op/equal.go | 18 ++++----- node/expr/binary_op/greater.go | 18 ++++----- node/expr/binary_op/greater_or_equal.go | 18 ++++----- node/expr/binary_op/identical.go | 18 ++++----- node/expr/binary_op/logical_and.go | 18 ++++----- node/expr/binary_op/logical_or.go | 18 ++++----- node/expr/binary_op/logical_xor.go | 18 ++++----- node/expr/binary_op/minus.go | 18 ++++----- node/expr/binary_op/mod.go | 18 ++++----- node/expr/binary_op/mul.go | 18 ++++----- node/expr/binary_op/not_equal.go | 18 ++++----- node/expr/binary_op/not_identical.go | 18 ++++----- node/expr/binary_op/plus.go | 18 ++++----- node/expr/binary_op/pow.go | 18 ++++----- node/expr/binary_op/shift_left.go | 18 ++++----- node/expr/binary_op/shift_right.go | 18 ++++----- node/expr/binary_op/smaller.go | 18 ++++----- node/expr/binary_op/smaller_or_equal.go | 18 ++++----- node/expr/binary_op/spaceship.go | 18 ++++----- node/expr/bitwise_not.go | 4 +- node/expr/boolean_not.go | 4 +- node/expr/class_const_fetch.go | 22 +++++------ node/expr/clone.go | 4 +- node/expr/closure.go | 42 ++++++++++---------- node/expr/closure_use.go | 12 +++--- node/expr/const_fetch.go | 12 +++--- node/expr/empty.go | 4 +- node/expr/error_suppress.go | 4 +- node/expr/eval.go | 4 +- node/expr/function_call.go | 22 +++++------ node/expr/include.go | 4 +- node/expr/include_once.go | 4 +- node/expr/instance_of.go | 12 +++--- node/expr/isset.go | 12 +++--- node/expr/list.go | 12 +++--- node/expr/method_call.go | 32 +++++++-------- node/expr/new.go | 22 +++++------ node/expr/post_dec.go | 12 +++--- node/expr/post_inc.go | 12 +++--- node/expr/pre_dec.go | 12 +++--- node/expr/pre_inc.go | 12 +++--- node/expr/print.go | 4 +- node/expr/property_fetch.go | 22 +++++------ node/expr/require.go | 4 +- node/expr/require_once.go | 4 +- node/expr/shell_exec.go | 12 +++--- node/expr/short_array.go | 12 +++--- node/expr/short_list.go | 12 +++--- node/expr/static_call.go | 32 +++++++-------- node/expr/static_property_fetch.go | 22 +++++------ node/expr/ternary.go | 32 +++++++-------- node/expr/unary_minus.go | 4 +- node/expr/unary_plus.go | 4 +- node/expr/variable.go | 12 +++--- node/expr/yield.go | 22 +++++------ node/expr/yield_from.go | 4 +- node/identifier.go | 10 ++--- node/name/fully_qualified.go | 4 +- node/name/name.go | 12 +++--- node/name/name_part.go | 4 +- node/name/relative.go | 4 +- node/nullable.go | 12 +++--- node/parameter.go | 40 +++++++++---------- node/scalar/dnumber.go | 4 +- node/scalar/encapsed.go | 12 +++--- node/scalar/encapsed_string_part.go | 4 +- node/scalar/lnumber.go | 4 +- node/scalar/magic_constant.go | 4 +- node/scalar/string.go | 4 +- node/stmt/alt_else.go | 12 +++--- node/stmt/alt_else_if.go | 22 +++++------ node/stmt/alt_if.go | 38 +++++++++--------- node/stmt/case.go | 22 +++++------ node/stmt/catch.go | 26 ++++++------- node/stmt/class.go | 52 ++++++++++++------------- node/stmt/class_const_list.go | 22 +++++------ node/stmt/class_method.go | 52 ++++++++++++------------- node/stmt/const_list.go | 12 +++--- node/stmt/constant.go | 12 +++--- node/stmt/declare.go | 22 +++++------ node/stmt/default.go | 12 +++--- node/stmt/do.go | 22 +++++------ node/stmt/echo.go | 12 +++--- node/stmt/else.go | 12 +++--- node/stmt/else_if.go | 22 +++++------ node/stmt/finally.go | 12 +++--- node/stmt/for.go | 42 ++++++++++---------- node/stmt/foreach.go | 32 +++++++-------- node/stmt/global.go | 12 +++--- node/stmt/goto.go | 12 +++--- node/stmt/group_use.go | 36 ++++++++--------- node/stmt/if.go | 38 +++++++++--------- node/stmt/inline_html.go | 4 +- node/stmt/interface.go | 32 +++++++-------- node/stmt/label.go | 12 +++--- node/stmt/namespace.go | 22 +++++------ node/stmt/property.go | 12 +++--- node/stmt/property_list.go | 22 +++++------ node/stmt/static.go | 12 +++--- node/stmt/static_var.go | 12 +++--- node/stmt/stmt_list.go | 14 +++---- node/stmt/switch.go | 12 +++--- node/stmt/trait.go | 22 +++++------ node/stmt/trait_method_ref.go | 22 +++++------ node/stmt/trait_use.go | 22 +++++------ node/stmt/trait_use_alias.go | 32 +++++++-------- node/stmt/trait_use_precedence.go | 22 +++++------ node/stmt/try.go | 32 +++++++-------- node/stmt/unset.go | 12 +++--- node/stmt/use.go | 40 +++++++++---------- node/stmt/use_list.go | 28 +++++++------ node/stmt/while.go | 32 +++++++-------- node/visitor.go | 2 +- 141 files changed, 1192 insertions(+), 1198 deletions(-) diff --git a/node/argument.go b/node/argument.go index 5931207..10b56d6 100644 --- a/node/argument.go +++ b/node/argument.go @@ -7,13 +7,13 @@ type Argument struct { variadic bool } -func NewArgument(expression Node, variadic bool) Node { +func NewArgument(Expression Node, variadic bool) Node { return &Argument{ map[string]interface{}{ "variadic": variadic, }, nil, - expression, + Expression, variadic, } } @@ -22,12 +22,12 @@ func (n Argument) Attributes() map[string]interface{} { return n.attributes } -func (n Argument) Attribute(key string) interface{} { - return n.attributes[key] +func (n Argument) Attribute(Key string) interface{} { + return n.attributes[Key] } -func (n Argument) SetAttribute(key string, value interface{}) Node { - n.attributes[key] = value +func (n Argument) SetAttribute(Key string, Value interface{}) Node { + n.attributes[Key] = Value return n } diff --git a/node/expr/array.go b/node/expr/array.go index b55442c..042d2cc 100644 --- a/node/expr/array.go +++ b/node/expr/array.go @@ -7,14 +7,14 @@ import ( type Array struct { attributes map[string]interface{} position *node.Position - items []node.Node + Items []node.Node } -func NewArray(items []node.Node) node.Node { +func NewArray(Items []node.Node) node.Node { return &Array{ map[string]interface{}{}, nil, - items, + Items, } } @@ -36,9 +36,9 @@ func (n Array) Walk(v node.Visitor) { return } - if n.items != nil { - vv := v.GetChildrenVisitor("items") - for _, nn := range n.items { + if n.Items != nil { + vv := v.GetChildrenVisitor("Items") + for _, nn := range n.Items { nn.Walk(vv) } } diff --git a/node/expr/array_dim_fetch.go b/node/expr/array_dim_fetch.go index a4e851e..b4f6bb8 100644 --- a/node/expr/array_dim_fetch.go +++ b/node/expr/array_dim_fetch.go @@ -7,16 +7,16 @@ import ( type ArrayDimFetch struct { attributes map[string]interface{} position *node.Position - variable node.Node - dim node.Node + Variable node.Node + Dim node.Node } -func NewArrayDimFetch(variable node.Node, dim node.Node) node.Node { +func NewArrayDimFetch(Variable node.Node, Dim node.Node) node.Node { return &ArrayDimFetch{ map[string]interface{}{}, nil, - variable, - dim, + Variable, + Dim, } } @@ -38,14 +38,14 @@ func (n ArrayDimFetch) Walk(v node.Visitor) { return } - if n.variable != nil { - vv := v.GetChildrenVisitor("variable") - n.variable.Walk(vv) + if n.Variable != nil { + vv := v.GetChildrenVisitor("Variable") + n.Variable.Walk(vv) } - if n.dim != nil { - vv := v.GetChildrenVisitor("dim") - n.dim.Walk(vv) + if n.Dim != nil { + vv := v.GetChildrenVisitor("Dim") + n.Dim.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/array_item.go b/node/expr/array_item.go index 06e71de..1c58875 100644 --- a/node/expr/array_item.go +++ b/node/expr/array_item.go @@ -7,18 +7,18 @@ import ( type ArrayItem struct { attributes map[string]interface{} position *node.Position - key node.Node - val node.Node + Key node.Node + Val node.Node } -func NewArrayItem(key node.Node, val node.Node, byRef bool) node.Node { +func NewArrayItem(Key node.Node, Val node.Node, byRef bool) node.Node { return &ArrayItem{ map[string]interface{}{ "byRef": byRef, }, nil, - key, - val, + Key, + Val, } } @@ -40,14 +40,14 @@ func (n ArrayItem) Walk(v node.Visitor) { return } - if n.key != nil { - vv := v.GetChildrenVisitor("key") - n.key.Walk(vv) + if n.Key != nil { + vv := v.GetChildrenVisitor("Key") + n.Key.Walk(vv) } - if n.val != nil { - vv := v.GetChildrenVisitor("val") - n.val.Walk(vv) + if n.Val != nil { + vv := v.GetChildrenVisitor("Val") + n.Val.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/assign_op/assign.go b/node/expr/assign_op/assign.go index c0c42f3..779983d 100644 --- a/node/expr/assign_op/assign.go +++ b/node/expr/assign_op/assign.go @@ -8,13 +8,13 @@ type Assign struct { AssignOp } -func NewAssign(variable node.Node, expression node.Node) node.Node { +func NewAssign(Variable node.Node, Expression node.Node) node.Node { return &Assign{ AssignOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n Assign) Walk(v node.Visitor) { return } - if n.variable != nil { - vv := v.GetChildrenVisitor("variable") - n.variable.Walk(vv) + if n.Variable != nil { + vv := v.GetChildrenVisitor("Variable") + n.Variable.Walk(vv) } - if n.expression != nil { - vv := v.GetChildrenVisitor("expression") - n.expression.Walk(vv) + if n.Expression != nil { + vv := v.GetChildrenVisitor("Expression") + n.Expression.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/assign_op/assign_op.go b/node/expr/assign_op/assign_op.go index 8b1ff53..ccec608 100644 --- a/node/expr/assign_op/assign_op.go +++ b/node/expr/assign_op/assign_op.go @@ -7,6 +7,6 @@ import ( type AssignOp struct { attributes map[string]interface{} position *node.Position - variable node.Node - expression node.Node + Variable node.Node + Expression node.Node } diff --git a/node/expr/assign_op/assign_ref.go b/node/expr/assign_op/assign_ref.go index d324348..de84a41 100644 --- a/node/expr/assign_op/assign_ref.go +++ b/node/expr/assign_op/assign_ref.go @@ -8,13 +8,13 @@ type AssignRef struct { AssignOp } -func NewAssignRef(variable node.Node, expression node.Node) node.Node { +func NewAssignRef(Variable node.Node, Expression node.Node) node.Node { return &AssignRef{ AssignOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n AssignRef) Walk(v node.Visitor) { return } - if n.variable != nil { - vv := v.GetChildrenVisitor("variable") - n.variable.Walk(vv) + if n.Variable != nil { + vv := v.GetChildrenVisitor("Variable") + n.Variable.Walk(vv) } - if n.expression != nil { - vv := v.GetChildrenVisitor("expression") - n.expression.Walk(vv) + if n.Expression != nil { + vv := v.GetChildrenVisitor("Expression") + n.Expression.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/assign_op/bitwise_and.go b/node/expr/assign_op/bitwise_and.go index ad970ca..f8269d9 100644 --- a/node/expr/assign_op/bitwise_and.go +++ b/node/expr/assign_op/bitwise_and.go @@ -8,13 +8,13 @@ type BitwiseAnd struct { AssignOp } -func NewBitwiseAnd(variable node.Node, expression node.Node) node.Node { +func NewBitwiseAnd(Variable node.Node, Expression node.Node) node.Node { return &BitwiseAnd{ AssignOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n BitwiseAnd) Walk(v node.Visitor) { return } - if n.variable != nil { - vv := v.GetChildrenVisitor("variable") - n.variable.Walk(vv) + if n.Variable != nil { + vv := v.GetChildrenVisitor("Variable") + n.Variable.Walk(vv) } - if n.expression != nil { - vv := v.GetChildrenVisitor("expression") - n.expression.Walk(vv) + if n.Expression != nil { + vv := v.GetChildrenVisitor("Expression") + n.Expression.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/assign_op/bitwise_or.go b/node/expr/assign_op/bitwise_or.go index 826cdfb..8fad15a 100644 --- a/node/expr/assign_op/bitwise_or.go +++ b/node/expr/assign_op/bitwise_or.go @@ -8,13 +8,13 @@ type BitwiseOr struct { AssignOp } -func NewBitwiseOr(variable node.Node, expression node.Node) node.Node { +func NewBitwiseOr(Variable node.Node, Expression node.Node) node.Node { return &BitwiseOr{ AssignOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n BitwiseOr) Walk(v node.Visitor) { return } - if n.variable != nil { - vv := v.GetChildrenVisitor("variable") - n.variable.Walk(vv) + if n.Variable != nil { + vv := v.GetChildrenVisitor("Variable") + n.Variable.Walk(vv) } - if n.expression != nil { - vv := v.GetChildrenVisitor("expression") - n.expression.Walk(vv) + if n.Expression != nil { + vv := v.GetChildrenVisitor("Expression") + n.Expression.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/assign_op/bitwise_xor.go b/node/expr/assign_op/bitwise_xor.go index 0de044b..d385a8b 100644 --- a/node/expr/assign_op/bitwise_xor.go +++ b/node/expr/assign_op/bitwise_xor.go @@ -8,13 +8,13 @@ type BitwiseXor struct { AssignOp } -func NewBitwiseXor(variable node.Node, expression node.Node) node.Node { +func NewBitwiseXor(Variable node.Node, Expression node.Node) node.Node { return &BitwiseXor{ AssignOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n BitwiseXor) Walk(v node.Visitor) { return } - if n.variable != nil { - vv := v.GetChildrenVisitor("variable") - n.variable.Walk(vv) + if n.Variable != nil { + vv := v.GetChildrenVisitor("Variable") + n.Variable.Walk(vv) } - if n.expression != nil { - vv := v.GetChildrenVisitor("expression") - n.expression.Walk(vv) + if n.Expression != nil { + vv := v.GetChildrenVisitor("Expression") + n.Expression.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/assign_op/concat.go b/node/expr/assign_op/concat.go index 23b6ecd..ce355df 100644 --- a/node/expr/assign_op/concat.go +++ b/node/expr/assign_op/concat.go @@ -8,13 +8,13 @@ type Concat struct { AssignOp } -func NewConcat(variable node.Node, expression node.Node) node.Node { +func NewConcat(Variable node.Node, Expression node.Node) node.Node { return &Concat{ AssignOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n Concat) Walk(v node.Visitor) { return } - if n.variable != nil { - vv := v.GetChildrenVisitor("variable") - n.variable.Walk(vv) + if n.Variable != nil { + vv := v.GetChildrenVisitor("Variable") + n.Variable.Walk(vv) } - if n.expression != nil { - vv := v.GetChildrenVisitor("expression") - n.expression.Walk(vv) + if n.Expression != nil { + vv := v.GetChildrenVisitor("Expression") + n.Expression.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/assign_op/div.go b/node/expr/assign_op/div.go index 2ada1a1..4a79969 100644 --- a/node/expr/assign_op/div.go +++ b/node/expr/assign_op/div.go @@ -8,13 +8,13 @@ type Div struct { AssignOp } -func NewDiv(variable node.Node, expression node.Node) node.Node { +func NewDiv(Variable node.Node, Expression node.Node) node.Node { return &Div{ AssignOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n Div) Walk(v node.Visitor) { return } - if n.variable != nil { - vv := v.GetChildrenVisitor("variable") - n.variable.Walk(vv) + if n.Variable != nil { + vv := v.GetChildrenVisitor("Variable") + n.Variable.Walk(vv) } - if n.expression != nil { - vv := v.GetChildrenVisitor("expression") - n.expression.Walk(vv) + if n.Expression != nil { + vv := v.GetChildrenVisitor("Expression") + n.Expression.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/assign_op/minus.go b/node/expr/assign_op/minus.go index 988a896..b9edbb5 100644 --- a/node/expr/assign_op/minus.go +++ b/node/expr/assign_op/minus.go @@ -8,13 +8,13 @@ type Minus struct { AssignOp } -func NewMinus(variable node.Node, expression node.Node) node.Node { +func NewMinus(Variable node.Node, Expression node.Node) node.Node { return &Minus{ AssignOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n Minus) Walk(v node.Visitor) { return } - if n.variable != nil { - vv := v.GetChildrenVisitor("variable") - n.variable.Walk(vv) + if n.Variable != nil { + vv := v.GetChildrenVisitor("Variable") + n.Variable.Walk(vv) } - if n.expression != nil { - vv := v.GetChildrenVisitor("expression") - n.expression.Walk(vv) + if n.Expression != nil { + vv := v.GetChildrenVisitor("Expression") + n.Expression.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/assign_op/mod.go b/node/expr/assign_op/mod.go index 3f15ee6..4ab2e90 100644 --- a/node/expr/assign_op/mod.go +++ b/node/expr/assign_op/mod.go @@ -8,13 +8,13 @@ type Mod struct { AssignOp } -func NewMod(variable node.Node, expression node.Node) node.Node { +func NewMod(Variable node.Node, Expression node.Node) node.Node { return &Mod{ AssignOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n Mod) Walk(v node.Visitor) { return } - if n.variable != nil { - vv := v.GetChildrenVisitor("variable") - n.variable.Walk(vv) + if n.Variable != nil { + vv := v.GetChildrenVisitor("Variable") + n.Variable.Walk(vv) } - if n.expression != nil { - vv := v.GetChildrenVisitor("expression") - n.expression.Walk(vv) + if n.Expression != nil { + vv := v.GetChildrenVisitor("Expression") + n.Expression.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/assign_op/mul.go b/node/expr/assign_op/mul.go index 77da737..8db763e 100644 --- a/node/expr/assign_op/mul.go +++ b/node/expr/assign_op/mul.go @@ -8,13 +8,13 @@ type Mul struct { AssignOp } -func NewMul(variable node.Node, expression node.Node) node.Node { +func NewMul(Variable node.Node, Expression node.Node) node.Node { return &Mul{ AssignOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n Mul) Walk(v node.Visitor) { return } - if n.variable != nil { - vv := v.GetChildrenVisitor("variable") - n.variable.Walk(vv) + if n.Variable != nil { + vv := v.GetChildrenVisitor("Variable") + n.Variable.Walk(vv) } - if n.expression != nil { - vv := v.GetChildrenVisitor("expression") - n.expression.Walk(vv) + if n.Expression != nil { + vv := v.GetChildrenVisitor("Expression") + n.Expression.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/assign_op/plus.go b/node/expr/assign_op/plus.go index 712f321..6938f59 100644 --- a/node/expr/assign_op/plus.go +++ b/node/expr/assign_op/plus.go @@ -8,13 +8,13 @@ type Plus struct { AssignOp } -func NewPlus(variable node.Node, expression node.Node) node.Node { +func NewPlus(Variable node.Node, Expression node.Node) node.Node { return &Plus{ AssignOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n Plus) Walk(v node.Visitor) { return } - if n.variable != nil { - vv := v.GetChildrenVisitor("variable") - n.variable.Walk(vv) + if n.Variable != nil { + vv := v.GetChildrenVisitor("Variable") + n.Variable.Walk(vv) } - if n.expression != nil { - vv := v.GetChildrenVisitor("expression") - n.expression.Walk(vv) + if n.Expression != nil { + vv := v.GetChildrenVisitor("Expression") + n.Expression.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/assign_op/pow.go b/node/expr/assign_op/pow.go index d455fd1..2e0f28e 100644 --- a/node/expr/assign_op/pow.go +++ b/node/expr/assign_op/pow.go @@ -8,13 +8,13 @@ type Pow struct { AssignOp } -func NewPow(variable node.Node, expression node.Node) node.Node { +func NewPow(Variable node.Node, Expression node.Node) node.Node { return &Pow{ AssignOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n Pow) Walk(v node.Visitor) { return } - if n.variable != nil { - vv := v.GetChildrenVisitor("variable") - n.variable.Walk(vv) + if n.Variable != nil { + vv := v.GetChildrenVisitor("Variable") + n.Variable.Walk(vv) } - if n.expression != nil { - vv := v.GetChildrenVisitor("expression") - n.expression.Walk(vv) + if n.Expression != nil { + vv := v.GetChildrenVisitor("Expression") + n.Expression.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/assign_op/shift_left.go b/node/expr/assign_op/shift_left.go index bf4fa67..7477e79 100644 --- a/node/expr/assign_op/shift_left.go +++ b/node/expr/assign_op/shift_left.go @@ -8,13 +8,13 @@ type ShiftLeft struct { AssignOp } -func NewShiftLeft(variable node.Node, expression node.Node) node.Node { +func NewShiftLeft(Variable node.Node, Expression node.Node) node.Node { return &ShiftLeft{ AssignOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n ShiftLeft) Walk(v node.Visitor) { return } - if n.variable != nil { - vv := v.GetChildrenVisitor("variable") - n.variable.Walk(vv) + if n.Variable != nil { + vv := v.GetChildrenVisitor("Variable") + n.Variable.Walk(vv) } - if n.expression != nil { - vv := v.GetChildrenVisitor("expression") - n.expression.Walk(vv) + if n.Expression != nil { + vv := v.GetChildrenVisitor("Expression") + n.Expression.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/assign_op/shift_right.go b/node/expr/assign_op/shift_right.go index fb70a47..a95d10d 100644 --- a/node/expr/assign_op/shift_right.go +++ b/node/expr/assign_op/shift_right.go @@ -8,13 +8,13 @@ type ShiftRight struct { AssignOp } -func NewShiftRight(variable node.Node, expression node.Node) node.Node { +func NewShiftRight(Variable node.Node, Expression node.Node) node.Node { return &ShiftRight{ AssignOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n ShiftRight) Walk(v node.Visitor) { return } - if n.variable != nil { - vv := v.GetChildrenVisitor("variable") - n.variable.Walk(vv) + if n.Variable != nil { + vv := v.GetChildrenVisitor("Variable") + n.Variable.Walk(vv) } - if n.expression != nil { - vv := v.GetChildrenVisitor("expression") - n.expression.Walk(vv) + if n.Expression != nil { + vv := v.GetChildrenVisitor("Expression") + n.Expression.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/binary_op/binary_op.go b/node/expr/binary_op/binary_op.go index 79b2baa..d1f113b 100644 --- a/node/expr/binary_op/binary_op.go +++ b/node/expr/binary_op/binary_op.go @@ -7,6 +7,6 @@ import ( type BinaryOp struct { attributes map[string]interface{} position *node.Position - left node.Node - right node.Node + Left node.Node + Right node.Node } diff --git a/node/expr/binary_op/bitwise_and.go b/node/expr/binary_op/bitwise_and.go index fa638f9..b5732a4 100644 --- a/node/expr/binary_op/bitwise_and.go +++ b/node/expr/binary_op/bitwise_and.go @@ -8,13 +8,13 @@ type BitwiseAnd struct { BinaryOp } -func NewBitwiseAnd(variable node.Node, expression node.Node) node.Node { +func NewBitwiseAnd(Variable node.Node, Expression node.Node) node.Node { return &BitwiseAnd{ BinaryOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n BitwiseAnd) Walk(v node.Visitor) { return } - if n.left != nil { - vv := v.GetChildrenVisitor("left") - n.left.Walk(vv) + if n.Left != nil { + vv := v.GetChildrenVisitor("Left") + n.Left.Walk(vv) } - if n.right != nil { - vv := v.GetChildrenVisitor("right") - n.right.Walk(vv) + if n.Right != nil { + vv := v.GetChildrenVisitor("Right") + n.Right.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/binary_op/bitwise_or.go b/node/expr/binary_op/bitwise_or.go index 2505979..e6e8c90 100644 --- a/node/expr/binary_op/bitwise_or.go +++ b/node/expr/binary_op/bitwise_or.go @@ -8,13 +8,13 @@ type BitwiseOr struct { BinaryOp } -func NewBitwiseOr(variable node.Node, expression node.Node) node.Node { +func NewBitwiseOr(Variable node.Node, Expression node.Node) node.Node { return &BitwiseOr{ BinaryOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n BitwiseOr) Walk(v node.Visitor) { return } - if n.left != nil { - vv := v.GetChildrenVisitor("left") - n.left.Walk(vv) + if n.Left != nil { + vv := v.GetChildrenVisitor("Left") + n.Left.Walk(vv) } - if n.right != nil { - vv := v.GetChildrenVisitor("right") - n.right.Walk(vv) + if n.Right != nil { + vv := v.GetChildrenVisitor("Right") + n.Right.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/binary_op/bitwise_xor.go b/node/expr/binary_op/bitwise_xor.go index a48ea3f..d8fa064 100644 --- a/node/expr/binary_op/bitwise_xor.go +++ b/node/expr/binary_op/bitwise_xor.go @@ -8,13 +8,13 @@ type BitwiseXor struct { BinaryOp } -func NewBitwiseXor(variable node.Node, expression node.Node) node.Node { +func NewBitwiseXor(Variable node.Node, Expression node.Node) node.Node { return &BitwiseXor{ BinaryOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n BitwiseXor) Walk(v node.Visitor) { return } - if n.left != nil { - vv := v.GetChildrenVisitor("left") - n.left.Walk(vv) + if n.Left != nil { + vv := v.GetChildrenVisitor("Left") + n.Left.Walk(vv) } - if n.right != nil { - vv := v.GetChildrenVisitor("right") - n.right.Walk(vv) + if n.Right != nil { + vv := v.GetChildrenVisitor("Right") + n.Right.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/binary_op/boolean_and.go b/node/expr/binary_op/boolean_and.go index 6ebc6b8..ff556d9 100644 --- a/node/expr/binary_op/boolean_and.go +++ b/node/expr/binary_op/boolean_and.go @@ -8,13 +8,13 @@ type BooleanAnd struct { BinaryOp } -func NewBooleanAnd(variable node.Node, expression node.Node) node.Node { +func NewBooleanAnd(Variable node.Node, Expression node.Node) node.Node { return &BooleanAnd{ BinaryOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n BooleanAnd) Walk(v node.Visitor) { return } - if n.left != nil { - vv := v.GetChildrenVisitor("left") - n.left.Walk(vv) + if n.Left != nil { + vv := v.GetChildrenVisitor("Left") + n.Left.Walk(vv) } - if n.right != nil { - vv := v.GetChildrenVisitor("right") - n.right.Walk(vv) + if n.Right != nil { + vv := v.GetChildrenVisitor("Right") + n.Right.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/binary_op/boolean_or.go b/node/expr/binary_op/boolean_or.go index 28a9848..f946263 100644 --- a/node/expr/binary_op/boolean_or.go +++ b/node/expr/binary_op/boolean_or.go @@ -8,13 +8,13 @@ type BooleanOr struct { BinaryOp } -func NewBooleanOr(variable node.Node, expression node.Node) node.Node { +func NewBooleanOr(Variable node.Node, Expression node.Node) node.Node { return &BooleanOr{ BinaryOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n BooleanOr) Walk(v node.Visitor) { return } - if n.left != nil { - vv := v.GetChildrenVisitor("left") - n.left.Walk(vv) + if n.Left != nil { + vv := v.GetChildrenVisitor("Left") + n.Left.Walk(vv) } - if n.right != nil { - vv := v.GetChildrenVisitor("right") - n.right.Walk(vv) + if n.Right != nil { + vv := v.GetChildrenVisitor("Right") + n.Right.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/binary_op/coalesce.go b/node/expr/binary_op/coalesce.go index 2f4ae2e..c70cca8 100644 --- a/node/expr/binary_op/coalesce.go +++ b/node/expr/binary_op/coalesce.go @@ -8,13 +8,13 @@ type Coalesce struct { BinaryOp } -func NewCoalesce(variable node.Node, expression node.Node) node.Node { +func NewCoalesce(Variable node.Node, Expression node.Node) node.Node { return &Coalesce{ BinaryOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n Coalesce) Walk(v node.Visitor) { return } - if n.left != nil { - vv := v.GetChildrenVisitor("left") - n.left.Walk(vv) + if n.Left != nil { + vv := v.GetChildrenVisitor("Left") + n.Left.Walk(vv) } - if n.right != nil { - vv := v.GetChildrenVisitor("right") - n.right.Walk(vv) + if n.Right != nil { + vv := v.GetChildrenVisitor("Right") + n.Right.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/binary_op/concat.go b/node/expr/binary_op/concat.go index f95af5d..2027ccd 100644 --- a/node/expr/binary_op/concat.go +++ b/node/expr/binary_op/concat.go @@ -8,13 +8,13 @@ type Concat struct { BinaryOp } -func NewConcat(variable node.Node, expression node.Node) node.Node { +func NewConcat(Variable node.Node, Expression node.Node) node.Node { return &Concat{ BinaryOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n Concat) Walk(v node.Visitor) { return } - if n.left != nil { - vv := v.GetChildrenVisitor("left") - n.left.Walk(vv) + if n.Left != nil { + vv := v.GetChildrenVisitor("Left") + n.Left.Walk(vv) } - if n.right != nil { - vv := v.GetChildrenVisitor("right") - n.right.Walk(vv) + if n.Right != nil { + vv := v.GetChildrenVisitor("Right") + n.Right.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/binary_op/div.go b/node/expr/binary_op/div.go index 585d412..b814af3 100644 --- a/node/expr/binary_op/div.go +++ b/node/expr/binary_op/div.go @@ -8,13 +8,13 @@ type Div struct { BinaryOp } -func NewDiv(variable node.Node, expression node.Node) node.Node { +func NewDiv(Variable node.Node, Expression node.Node) node.Node { return &Div{ BinaryOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n Div) Walk(v node.Visitor) { return } - if n.left != nil { - vv := v.GetChildrenVisitor("left") - n.left.Walk(vv) + if n.Left != nil { + vv := v.GetChildrenVisitor("Left") + n.Left.Walk(vv) } - if n.right != nil { - vv := v.GetChildrenVisitor("right") - n.right.Walk(vv) + if n.Right != nil { + vv := v.GetChildrenVisitor("Right") + n.Right.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/binary_op/equal.go b/node/expr/binary_op/equal.go index d22dd27..b72811a 100644 --- a/node/expr/binary_op/equal.go +++ b/node/expr/binary_op/equal.go @@ -8,13 +8,13 @@ type Equal struct { BinaryOp } -func NewEqual(variable node.Node, expression node.Node) node.Node { +func NewEqual(Variable node.Node, Expression node.Node) node.Node { return &Equal{ BinaryOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n Equal) Walk(v node.Visitor) { return } - if n.left != nil { - vv := v.GetChildrenVisitor("left") - n.left.Walk(vv) + if n.Left != nil { + vv := v.GetChildrenVisitor("Left") + n.Left.Walk(vv) } - if n.right != nil { - vv := v.GetChildrenVisitor("right") - n.right.Walk(vv) + if n.Right != nil { + vv := v.GetChildrenVisitor("Right") + n.Right.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/binary_op/greater.go b/node/expr/binary_op/greater.go index 4ae7991..27e67c0 100644 --- a/node/expr/binary_op/greater.go +++ b/node/expr/binary_op/greater.go @@ -8,13 +8,13 @@ type Greater struct { BinaryOp } -func NewGreater(variable node.Node, expression node.Node) node.Node { +func NewGreater(Variable node.Node, Expression node.Node) node.Node { return &Greater{ BinaryOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n Greater) Walk(v node.Visitor) { return } - if n.left != nil { - vv := v.GetChildrenVisitor("left") - n.left.Walk(vv) + if n.Left != nil { + vv := v.GetChildrenVisitor("Left") + n.Left.Walk(vv) } - if n.right != nil { - vv := v.GetChildrenVisitor("right") - n.right.Walk(vv) + if n.Right != nil { + vv := v.GetChildrenVisitor("Right") + n.Right.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/binary_op/greater_or_equal.go b/node/expr/binary_op/greater_or_equal.go index 6e0510a..9705f55 100644 --- a/node/expr/binary_op/greater_or_equal.go +++ b/node/expr/binary_op/greater_or_equal.go @@ -8,13 +8,13 @@ type GreaterOrEqual struct { BinaryOp } -func NewGreaterOrEqual(variable node.Node, expression node.Node) node.Node { +func NewGreaterOrEqual(Variable node.Node, Expression node.Node) node.Node { return &GreaterOrEqual{ BinaryOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n GreaterOrEqual) Walk(v node.Visitor) { return } - if n.left != nil { - vv := v.GetChildrenVisitor("left") - n.left.Walk(vv) + if n.Left != nil { + vv := v.GetChildrenVisitor("Left") + n.Left.Walk(vv) } - if n.right != nil { - vv := v.GetChildrenVisitor("right") - n.right.Walk(vv) + if n.Right != nil { + vv := v.GetChildrenVisitor("Right") + n.Right.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/binary_op/identical.go b/node/expr/binary_op/identical.go index e3f7d1c..8b969ae 100644 --- a/node/expr/binary_op/identical.go +++ b/node/expr/binary_op/identical.go @@ -8,13 +8,13 @@ type Identical struct { BinaryOp } -func NewIdentical(variable node.Node, expression node.Node) node.Node { +func NewIdentical(Variable node.Node, Expression node.Node) node.Node { return &Identical{ BinaryOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n Identical) Walk(v node.Visitor) { return } - if n.left != nil { - vv := v.GetChildrenVisitor("left") - n.left.Walk(vv) + if n.Left != nil { + vv := v.GetChildrenVisitor("Left") + n.Left.Walk(vv) } - if n.right != nil { - vv := v.GetChildrenVisitor("right") - n.right.Walk(vv) + if n.Right != nil { + vv := v.GetChildrenVisitor("Right") + n.Right.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/binary_op/logical_and.go b/node/expr/binary_op/logical_and.go index f800632..9bc9d92 100644 --- a/node/expr/binary_op/logical_and.go +++ b/node/expr/binary_op/logical_and.go @@ -8,13 +8,13 @@ type LogicalAnd struct { BinaryOp } -func NewLogicalAnd(variable node.Node, expression node.Node) node.Node { +func NewLogicalAnd(Variable node.Node, Expression node.Node) node.Node { return &LogicalAnd{ BinaryOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n LogicalAnd) Walk(v node.Visitor) { return } - if n.left != nil { - vv := v.GetChildrenVisitor("left") - n.left.Walk(vv) + if n.Left != nil { + vv := v.GetChildrenVisitor("Left") + n.Left.Walk(vv) } - if n.right != nil { - vv := v.GetChildrenVisitor("right") - n.right.Walk(vv) + if n.Right != nil { + vv := v.GetChildrenVisitor("Right") + n.Right.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/binary_op/logical_or.go b/node/expr/binary_op/logical_or.go index c9ecd6a..e9d2225 100644 --- a/node/expr/binary_op/logical_or.go +++ b/node/expr/binary_op/logical_or.go @@ -8,13 +8,13 @@ type LogicalOr struct { BinaryOp } -func NewLogicalOr(variable node.Node, expression node.Node) node.Node { +func NewLogicalOr(Variable node.Node, Expression node.Node) node.Node { return &LogicalOr{ BinaryOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n LogicalOr) Walk(v node.Visitor) { return } - if n.left != nil { - vv := v.GetChildrenVisitor("left") - n.left.Walk(vv) + if n.Left != nil { + vv := v.GetChildrenVisitor("Left") + n.Left.Walk(vv) } - if n.right != nil { - vv := v.GetChildrenVisitor("right") - n.right.Walk(vv) + if n.Right != nil { + vv := v.GetChildrenVisitor("Right") + n.Right.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/binary_op/logical_xor.go b/node/expr/binary_op/logical_xor.go index 81ea410..063ed21 100644 --- a/node/expr/binary_op/logical_xor.go +++ b/node/expr/binary_op/logical_xor.go @@ -8,13 +8,13 @@ type LogicalXor struct { BinaryOp } -func NewLogicalXor(variable node.Node, expression node.Node) node.Node { +func NewLogicalXor(Variable node.Node, Expression node.Node) node.Node { return &LogicalXor{ BinaryOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n LogicalXor) Walk(v node.Visitor) { return } - if n.left != nil { - vv := v.GetChildrenVisitor("left") - n.left.Walk(vv) + if n.Left != nil { + vv := v.GetChildrenVisitor("Left") + n.Left.Walk(vv) } - if n.right != nil { - vv := v.GetChildrenVisitor("right") - n.right.Walk(vv) + if n.Right != nil { + vv := v.GetChildrenVisitor("Right") + n.Right.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/binary_op/minus.go b/node/expr/binary_op/minus.go index 11020e1..f7f5f21 100644 --- a/node/expr/binary_op/minus.go +++ b/node/expr/binary_op/minus.go @@ -8,13 +8,13 @@ type Minus struct { BinaryOp } -func NewMinus(variable node.Node, expression node.Node) node.Node { +func NewMinus(Variable node.Node, Expression node.Node) node.Node { return &Minus{ BinaryOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n Minus) Walk(v node.Visitor) { return } - if n.left != nil { - vv := v.GetChildrenVisitor("left") - n.left.Walk(vv) + if n.Left != nil { + vv := v.GetChildrenVisitor("Left") + n.Left.Walk(vv) } - if n.right != nil { - vv := v.GetChildrenVisitor("right") - n.right.Walk(vv) + if n.Right != nil { + vv := v.GetChildrenVisitor("Right") + n.Right.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/binary_op/mod.go b/node/expr/binary_op/mod.go index dc94963..287c224 100644 --- a/node/expr/binary_op/mod.go +++ b/node/expr/binary_op/mod.go @@ -8,13 +8,13 @@ type Mod struct { BinaryOp } -func NewMod(variable node.Node, expression node.Node) node.Node { +func NewMod(Variable node.Node, Expression node.Node) node.Node { return &Mod{ BinaryOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n Mod) Walk(v node.Visitor) { return } - if n.left != nil { - vv := v.GetChildrenVisitor("left") - n.left.Walk(vv) + if n.Left != nil { + vv := v.GetChildrenVisitor("Left") + n.Left.Walk(vv) } - if n.right != nil { - vv := v.GetChildrenVisitor("right") - n.right.Walk(vv) + if n.Right != nil { + vv := v.GetChildrenVisitor("Right") + n.Right.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/binary_op/mul.go b/node/expr/binary_op/mul.go index 949ff9b..74d1c80 100644 --- a/node/expr/binary_op/mul.go +++ b/node/expr/binary_op/mul.go @@ -8,13 +8,13 @@ type Mul struct { BinaryOp } -func NewMul(variable node.Node, expression node.Node) node.Node { +func NewMul(Variable node.Node, Expression node.Node) node.Node { return &Mul{ BinaryOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n Mul) Walk(v node.Visitor) { return } - if n.left != nil { - vv := v.GetChildrenVisitor("left") - n.left.Walk(vv) + if n.Left != nil { + vv := v.GetChildrenVisitor("Left") + n.Left.Walk(vv) } - if n.right != nil { - vv := v.GetChildrenVisitor("right") - n.right.Walk(vv) + if n.Right != nil { + vv := v.GetChildrenVisitor("Right") + n.Right.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/binary_op/not_equal.go b/node/expr/binary_op/not_equal.go index 60be0f1..2016870 100644 --- a/node/expr/binary_op/not_equal.go +++ b/node/expr/binary_op/not_equal.go @@ -8,13 +8,13 @@ type NotEqual struct { BinaryOp } -func NewNotEqual(variable node.Node, expression node.Node) node.Node { +func NewNotEqual(Variable node.Node, Expression node.Node) node.Node { return &NotEqual{ BinaryOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n NotEqual) Walk(v node.Visitor) { return } - if n.left != nil { - vv := v.GetChildrenVisitor("left") - n.left.Walk(vv) + if n.Left != nil { + vv := v.GetChildrenVisitor("Left") + n.Left.Walk(vv) } - if n.right != nil { - vv := v.GetChildrenVisitor("right") - n.right.Walk(vv) + if n.Right != nil { + vv := v.GetChildrenVisitor("Right") + n.Right.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/binary_op/not_identical.go b/node/expr/binary_op/not_identical.go index 1fdc448..e81a125 100644 --- a/node/expr/binary_op/not_identical.go +++ b/node/expr/binary_op/not_identical.go @@ -8,13 +8,13 @@ type NotIdentical struct { BinaryOp } -func NewNotIdentical(variable node.Node, expression node.Node) node.Node { +func NewNotIdentical(Variable node.Node, Expression node.Node) node.Node { return &NotIdentical{ BinaryOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n NotIdentical) Walk(v node.Visitor) { return } - if n.left != nil { - vv := v.GetChildrenVisitor("left") - n.left.Walk(vv) + if n.Left != nil { + vv := v.GetChildrenVisitor("Left") + n.Left.Walk(vv) } - if n.right != nil { - vv := v.GetChildrenVisitor("right") - n.right.Walk(vv) + if n.Right != nil { + vv := v.GetChildrenVisitor("Right") + n.Right.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/binary_op/plus.go b/node/expr/binary_op/plus.go index c0d2c4d..9c7ce0d 100644 --- a/node/expr/binary_op/plus.go +++ b/node/expr/binary_op/plus.go @@ -8,13 +8,13 @@ type Plus struct { BinaryOp } -func NewPlus(variable node.Node, expression node.Node) node.Node { +func NewPlus(Variable node.Node, Expression node.Node) node.Node { return &Plus{ BinaryOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n Plus) Walk(v node.Visitor) { return } - if n.left != nil { - vv := v.GetChildrenVisitor("left") - n.left.Walk(vv) + if n.Left != nil { + vv := v.GetChildrenVisitor("Left") + n.Left.Walk(vv) } - if n.right != nil { - vv := v.GetChildrenVisitor("right") - n.right.Walk(vv) + if n.Right != nil { + vv := v.GetChildrenVisitor("Right") + n.Right.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/binary_op/pow.go b/node/expr/binary_op/pow.go index 42ed810..87a5a41 100644 --- a/node/expr/binary_op/pow.go +++ b/node/expr/binary_op/pow.go @@ -8,13 +8,13 @@ type Pow struct { BinaryOp } -func NewPow(variable node.Node, expression node.Node) node.Node { +func NewPow(Variable node.Node, Expression node.Node) node.Node { return &Pow{ BinaryOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n Pow) Walk(v node.Visitor) { return } - if n.left != nil { - vv := v.GetChildrenVisitor("left") - n.left.Walk(vv) + if n.Left != nil { + vv := v.GetChildrenVisitor("Left") + n.Left.Walk(vv) } - if n.right != nil { - vv := v.GetChildrenVisitor("right") - n.right.Walk(vv) + if n.Right != nil { + vv := v.GetChildrenVisitor("Right") + n.Right.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/binary_op/shift_left.go b/node/expr/binary_op/shift_left.go index 208a59e..7c6087e 100644 --- a/node/expr/binary_op/shift_left.go +++ b/node/expr/binary_op/shift_left.go @@ -8,13 +8,13 @@ type ShiftLeft struct { BinaryOp } -func NewShiftLeft(variable node.Node, expression node.Node) node.Node { +func NewShiftLeft(Variable node.Node, Expression node.Node) node.Node { return &ShiftLeft{ BinaryOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n ShiftLeft) Walk(v node.Visitor) { return } - if n.left != nil { - vv := v.GetChildrenVisitor("left") - n.left.Walk(vv) + if n.Left != nil { + vv := v.GetChildrenVisitor("Left") + n.Left.Walk(vv) } - if n.right != nil { - vv := v.GetChildrenVisitor("right") - n.right.Walk(vv) + if n.Right != nil { + vv := v.GetChildrenVisitor("Right") + n.Right.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/binary_op/shift_right.go b/node/expr/binary_op/shift_right.go index 9671861..4d37973 100644 --- a/node/expr/binary_op/shift_right.go +++ b/node/expr/binary_op/shift_right.go @@ -8,13 +8,13 @@ type ShiftRight struct { BinaryOp } -func NewShiftRight(variable node.Node, expression node.Node) node.Node { +func NewShiftRight(Variable node.Node, Expression node.Node) node.Node { return &ShiftRight{ BinaryOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n ShiftRight) Walk(v node.Visitor) { return } - if n.left != nil { - vv := v.GetChildrenVisitor("left") - n.left.Walk(vv) + if n.Left != nil { + vv := v.GetChildrenVisitor("Left") + n.Left.Walk(vv) } - if n.right != nil { - vv := v.GetChildrenVisitor("right") - n.right.Walk(vv) + if n.Right != nil { + vv := v.GetChildrenVisitor("Right") + n.Right.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/binary_op/smaller.go b/node/expr/binary_op/smaller.go index a00c070..02be9b0 100644 --- a/node/expr/binary_op/smaller.go +++ b/node/expr/binary_op/smaller.go @@ -8,13 +8,13 @@ type Smaller struct { BinaryOp } -func NewSmaller(variable node.Node, expression node.Node) node.Node { +func NewSmaller(Variable node.Node, Expression node.Node) node.Node { return &Smaller{ BinaryOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n Smaller) Walk(v node.Visitor) { return } - if n.left != nil { - vv := v.GetChildrenVisitor("left") - n.left.Walk(vv) + if n.Left != nil { + vv := v.GetChildrenVisitor("Left") + n.Left.Walk(vv) } - if n.right != nil { - vv := v.GetChildrenVisitor("right") - n.right.Walk(vv) + if n.Right != nil { + vv := v.GetChildrenVisitor("Right") + n.Right.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/binary_op/smaller_or_equal.go b/node/expr/binary_op/smaller_or_equal.go index 4397509..fdc1474 100644 --- a/node/expr/binary_op/smaller_or_equal.go +++ b/node/expr/binary_op/smaller_or_equal.go @@ -8,13 +8,13 @@ type SmallerOrEqual struct { BinaryOp } -func NewSmallerOrEqual(variable node.Node, expression node.Node) node.Node { +func NewSmallerOrEqual(Variable node.Node, Expression node.Node) node.Node { return &SmallerOrEqual{ BinaryOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n SmallerOrEqual) Walk(v node.Visitor) { return } - if n.left != nil { - vv := v.GetChildrenVisitor("left") - n.left.Walk(vv) + if n.Left != nil { + vv := v.GetChildrenVisitor("Left") + n.Left.Walk(vv) } - if n.right != nil { - vv := v.GetChildrenVisitor("right") - n.right.Walk(vv) + if n.Right != nil { + vv := v.GetChildrenVisitor("Right") + n.Right.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/binary_op/spaceship.go b/node/expr/binary_op/spaceship.go index 4913b5e..dd3ef89 100644 --- a/node/expr/binary_op/spaceship.go +++ b/node/expr/binary_op/spaceship.go @@ -8,13 +8,13 @@ type Spaceship struct { BinaryOp } -func NewSpaceship(variable node.Node, expression node.Node) node.Node { +func NewSpaceship(Variable node.Node, Expression node.Node) node.Node { return &Spaceship{ BinaryOp{ map[string]interface{}{}, nil, - variable, - expression, + Variable, + Expression, }, } } @@ -37,14 +37,14 @@ func (n Spaceship) Walk(v node.Visitor) { return } - if n.left != nil { - vv := v.GetChildrenVisitor("left") - n.left.Walk(vv) + if n.Left != nil { + vv := v.GetChildrenVisitor("Left") + n.Left.Walk(vv) } - if n.right != nil { - vv := v.GetChildrenVisitor("right") - n.right.Walk(vv) + if n.Right != nil { + vv := v.GetChildrenVisitor("Right") + n.Right.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/bitwise_not.go b/node/expr/bitwise_not.go index e80233e..6d9d405 100644 --- a/node/expr/bitwise_not.go +++ b/node/expr/bitwise_not.go @@ -10,11 +10,11 @@ type BitwiseNot struct { expr node.Node } -func NewBitwiseNot(expression node.Node) node.Node { +func NewBitwiseNot(Expression node.Node) node.Node { return &BitwiseNot{ map[string]interface{}{}, nil, - expression, + Expression, } } diff --git a/node/expr/boolean_not.go b/node/expr/boolean_not.go index dcbcbf0..d43f324 100644 --- a/node/expr/boolean_not.go +++ b/node/expr/boolean_not.go @@ -10,11 +10,11 @@ type BooleanNot struct { expr node.Node } -func NewBooleanNot(expression node.Node) node.Node { +func NewBooleanNot(Expression node.Node) node.Node { return &BooleanNot{ map[string]interface{}{}, nil, - expression, + Expression, } } diff --git a/node/expr/class_const_fetch.go b/node/expr/class_const_fetch.go index 6983dbd..292e83a 100644 --- a/node/expr/class_const_fetch.go +++ b/node/expr/class_const_fetch.go @@ -7,16 +7,16 @@ import ( type ClassConstFetch struct { attributes map[string]interface{} position *node.Position - class node.Node - constantName node.Node + Class node.Node + ConstantName node.Node } -func NewClassConstFetch(class node.Node, constantName node.Node) node.Node { +func NewClassConstFetch(Class node.Node, ConstantName node.Node) node.Node { return &ClassConstFetch{ map[string]interface{}{}, nil, - class, - constantName, + Class, + ConstantName, } } @@ -38,14 +38,14 @@ func (n ClassConstFetch) Walk(v node.Visitor) { return } - if n.constantName != nil { - vv := v.GetChildrenVisitor("constantName") - n.constantName.Walk(vv) + if n.ConstantName != nil { + vv := v.GetChildrenVisitor("ConstantName") + n.ConstantName.Walk(vv) } - if n.class != nil { - vv := v.GetChildrenVisitor("class") - n.class.Walk(vv) + if n.Class != nil { + vv := v.GetChildrenVisitor("Class") + n.Class.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/clone.go b/node/expr/clone.go index 1ff6e81..3963966 100644 --- a/node/expr/clone.go +++ b/node/expr/clone.go @@ -10,11 +10,11 @@ type Clone struct { expr node.Node } -func NewClone(expression node.Node) node.Node { +func NewClone(Expression node.Node) node.Node { return &Clone{ map[string]interface{}{}, nil, - expression, + Expression, } } diff --git a/node/expr/closure.go b/node/expr/closure.go index 8cfcdfc..bb2b49b 100644 --- a/node/expr/closure.go +++ b/node/expr/closure.go @@ -7,13 +7,13 @@ import ( type Closure struct { attributes map[string]interface{} position *node.Position - params []node.Node - uses []node.Node - returnType node.Node - stmts []node.Node + Params []node.Node + Uses []node.Node + ReturnType node.Node + Stmts []node.Node } -func NewClosure(params []node.Node, uses []node.Node, returnType node.Node, stmts []node.Node, isStatic bool, isReturnRef bool, phpDocComment string) node.Node { +func NewClosure(Params []node.Node, Uses []node.Node, ReturnType node.Node, Stmts []node.Node, isStatic bool, isReturnRef bool, phpDocComment string) node.Node { return &Closure{ map[string]interface{}{ "isReturnRef": isReturnRef, @@ -21,10 +21,10 @@ func NewClosure(params []node.Node, uses []node.Node, returnType node.Node, stmt "phpDocComment": phpDocComment, }, nil, - params, - uses, - returnType, - stmts, + Params, + Uses, + ReturnType, + Stmts, } } @@ -46,28 +46,28 @@ func (n Closure) Walk(v node.Visitor) { return } - if n.params != nil { - vv := v.GetChildrenVisitor("params") - for _, nn := range n.params { + if n.Params != nil { + vv := v.GetChildrenVisitor("Params") + for _, nn := range n.Params { nn.Walk(vv) } } - if n.uses != nil { - vv := v.GetChildrenVisitor("uses") - for _, nn := range n.uses { + if n.Uses != nil { + vv := v.GetChildrenVisitor("Uses") + for _, nn := range n.Uses { nn.Walk(vv) } } - if n.returnType != nil { - vv := v.GetChildrenVisitor("returnType") - n.returnType.Walk(vv) + if n.ReturnType != nil { + vv := v.GetChildrenVisitor("ReturnType") + n.ReturnType.Walk(vv) } - if n.stmts != nil { - vv := v.GetChildrenVisitor("stmts") - for _, nn := range n.stmts { + if n.Stmts != nil { + vv := v.GetChildrenVisitor("Stmts") + for _, nn := range n.Stmts { nn.Walk(vv) } } diff --git a/node/expr/closure_use.go b/node/expr/closure_use.go index a1ae1bc..3be98c9 100644 --- a/node/expr/closure_use.go +++ b/node/expr/closure_use.go @@ -7,16 +7,16 @@ import ( type ClusureUse struct { attributes map[string]interface{} position *node.Position - variable node.Node + Variable node.Node } -func NewClusureUse(variable node.Node, byRef bool) node.Node { +func NewClusureUse(Variable node.Node, byRef bool) node.Node { return &ClusureUse{ map[string]interface{}{ "byRef": byRef, }, nil, - variable, + Variable, } } @@ -38,9 +38,9 @@ func (n ClusureUse) Walk(v node.Visitor) { return } - if n.variable != nil { - vv := v.GetChildrenVisitor("variable") - n.variable.Walk(vv) + if n.Variable != nil { + vv := v.GetChildrenVisitor("Variable") + n.Variable.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/const_fetch.go b/node/expr/const_fetch.go index c73d331..05274e0 100644 --- a/node/expr/const_fetch.go +++ b/node/expr/const_fetch.go @@ -7,14 +7,14 @@ import ( type ConstFetch struct { attributes map[string]interface{} position *node.Position - constant node.Node + Constant node.Node } -func NewConstFetch(constant node.Node) node.Node { +func NewConstFetch(Constant node.Node) node.Node { return &ConstFetch{ map[string]interface{}{}, nil, - constant, + Constant, } } @@ -36,9 +36,9 @@ func (n ConstFetch) Walk(v node.Visitor) { return } - if n.constant != nil { - vv := v.GetChildrenVisitor("constant") - n.constant.Walk(vv) + if n.Constant != nil { + vv := v.GetChildrenVisitor("Constant") + n.Constant.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/empty.go b/node/expr/empty.go index 70dad47..aff7243 100644 --- a/node/expr/empty.go +++ b/node/expr/empty.go @@ -10,11 +10,11 @@ type Empty struct { expr node.Node } -func NewEmpty(expression node.Node) node.Node { +func NewEmpty(Expression node.Node) node.Node { return &Empty{ map[string]interface{}{}, nil, - expression, + Expression, } } diff --git a/node/expr/error_suppress.go b/node/expr/error_suppress.go index 7d81119..1852fed 100644 --- a/node/expr/error_suppress.go +++ b/node/expr/error_suppress.go @@ -10,11 +10,11 @@ type ErrorSuppress struct { expr node.Node } -func NewErrorSuppress(expression node.Node) node.Node { +func NewErrorSuppress(Expression node.Node) node.Node { return &ErrorSuppress{ map[string]interface{}{}, nil, - expression, + Expression, } } diff --git a/node/expr/eval.go b/node/expr/eval.go index 39283c6..58c0f68 100644 --- a/node/expr/eval.go +++ b/node/expr/eval.go @@ -10,11 +10,11 @@ type Eval struct { expr node.Node } -func NewEval(expression node.Node) node.Node { +func NewEval(Expression node.Node) node.Node { return &Eval{ map[string]interface{}{}, nil, - expression, + Expression, } } diff --git a/node/expr/function_call.go b/node/expr/function_call.go index aa5f0cc..bfc9a8c 100644 --- a/node/expr/function_call.go +++ b/node/expr/function_call.go @@ -7,16 +7,16 @@ import ( type FunctionCall struct { attributes map[string]interface{} position *node.Position - function node.Node - arguments []node.Node + Function node.Node + Arguments []node.Node } -func NewFunctionCall(function node.Node, arguments []node.Node) node.Node { +func NewFunctionCall(Function node.Node, Arguments []node.Node) node.Node { return &FunctionCall{ map[string]interface{}{}, nil, - function, - arguments, + Function, + Arguments, } } @@ -38,14 +38,14 @@ func (n FunctionCall) Walk(v node.Visitor) { return } - if n.function != nil { - vv := v.GetChildrenVisitor("function") - n.function.Walk(vv) + if n.Function != nil { + vv := v.GetChildrenVisitor("Function") + n.Function.Walk(vv) } - if n.arguments != nil { - vv := v.GetChildrenVisitor("arguments") - for _, nn := range n.arguments { + if n.Arguments != nil { + vv := v.GetChildrenVisitor("Arguments") + for _, nn := range n.Arguments { nn.Walk(vv) } } diff --git a/node/expr/include.go b/node/expr/include.go index 5e1b670..eaa19cb 100644 --- a/node/expr/include.go +++ b/node/expr/include.go @@ -10,11 +10,11 @@ type Include struct { expr node.Node } -func NewInclude(expression node.Node) node.Node { +func NewInclude(Expression node.Node) node.Node { return &Include{ map[string]interface{}{}, nil, - expression, + Expression, } } diff --git a/node/expr/include_once.go b/node/expr/include_once.go index 57eb81e..70dfdaa 100644 --- a/node/expr/include_once.go +++ b/node/expr/include_once.go @@ -10,11 +10,11 @@ type IncludeOnce struct { expr node.Node } -func NewIncludeOnce(expression node.Node) node.Node { +func NewIncludeOnce(Expression node.Node) node.Node { return &IncludeOnce{ map[string]interface{}{}, nil, - expression, + Expression, } } diff --git a/node/expr/instance_of.go b/node/expr/instance_of.go index 91fc558..d245181 100644 --- a/node/expr/instance_of.go +++ b/node/expr/instance_of.go @@ -8,15 +8,15 @@ type InstanceOf struct { attributes map[string]interface{} position *node.Position expr node.Node - class node.Node + Class node.Node } -func NewInstanceOf(expr node.Node, class node.Node) node.Node { +func NewInstanceOf(expr node.Node, Class node.Node) node.Node { return &InstanceOf{ map[string]interface{}{}, nil, expr, - class, + Class, } } @@ -43,9 +43,9 @@ func (n InstanceOf) Walk(v node.Visitor) { n.expr.Walk(vv) } - if n.class != nil { - vv := v.GetChildrenVisitor("class") - n.class.Walk(vv) + if n.Class != nil { + vv := v.GetChildrenVisitor("Class") + n.Class.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/isset.go b/node/expr/isset.go index 50ab30d..6cd08db 100644 --- a/node/expr/isset.go +++ b/node/expr/isset.go @@ -7,14 +7,14 @@ import ( type Isset struct { attributes map[string]interface{} position *node.Position - variables []node.Node + Variables []node.Node } -func NewIsset(variables []node.Node) node.Node { +func NewIsset(Variables []node.Node) node.Node { return &Isset{ map[string]interface{}{}, nil, - variables, + Variables, } } @@ -36,9 +36,9 @@ func (n Isset) Walk(v node.Visitor) { return } - if n.variables != nil { - vv := v.GetChildrenVisitor("variables") - for _, nn := range n.variables { + if n.Variables != nil { + vv := v.GetChildrenVisitor("Variables") + for _, nn := range n.Variables { nn.Walk(vv) } } diff --git a/node/expr/list.go b/node/expr/list.go index 53969b2..baacc57 100644 --- a/node/expr/list.go +++ b/node/expr/list.go @@ -7,14 +7,14 @@ import ( type List struct { attributes map[string]interface{} position *node.Position - items []node.Node + Items []node.Node } -func NewList(items []node.Node) node.Node { +func NewList(Items []node.Node) node.Node { return &List{ map[string]interface{}{}, nil, - items, + Items, } } @@ -36,9 +36,9 @@ func (n List) Walk(v node.Visitor) { return } - if n.items != nil { - vv := v.GetChildrenVisitor("items") - for _, nn := range n.items { + if n.Items != nil { + vv := v.GetChildrenVisitor("Items") + for _, nn := range n.Items { nn.Walk(vv) } } diff --git a/node/expr/method_call.go b/node/expr/method_call.go index a3ec5b7..b76504c 100644 --- a/node/expr/method_call.go +++ b/node/expr/method_call.go @@ -7,18 +7,18 @@ import ( type MethodCall struct { attributes map[string]interface{} position *node.Position - variable node.Node - method node.Node - arguments []node.Node + Variable node.Node + Method node.Node + Arguments []node.Node } -func NewMethodCall(variable node.Node, method node.Node, arguments []node.Node) node.Node { +func NewMethodCall(Variable node.Node, Method node.Node, Arguments []node.Node) node.Node { return &MethodCall{ map[string]interface{}{}, nil, - variable, - method, - arguments, + Variable, + Method, + Arguments, } } @@ -40,19 +40,19 @@ func (n MethodCall) Walk(v node.Visitor) { return } - if n.variable != nil { - vv := v.GetChildrenVisitor("variable") - n.variable.Walk(vv) + if n.Variable != nil { + vv := v.GetChildrenVisitor("Variable") + n.Variable.Walk(vv) } - if n.method != nil { - vv := v.GetChildrenVisitor("method") - n.method.Walk(vv) + if n.Method != nil { + vv := v.GetChildrenVisitor("Method") + n.Method.Walk(vv) } - if n.arguments != nil { - vv := v.GetChildrenVisitor("arguments") - for _, nn := range n.arguments { + if n.Arguments != nil { + vv := v.GetChildrenVisitor("Arguments") + for _, nn := range n.Arguments { nn.Walk(vv) } } diff --git a/node/expr/new.go b/node/expr/new.go index 408c84e..685f7e3 100644 --- a/node/expr/new.go +++ b/node/expr/new.go @@ -7,16 +7,16 @@ import ( type New struct { attributes map[string]interface{} position *node.Position - class node.Node - arguments []node.Node + Class node.Node + Arguments []node.Node } -func NewNew(class node.Node, arguments []node.Node) node.Node { +func NewNew(Class node.Node, Arguments []node.Node) node.Node { return &New{ map[string]interface{}{}, nil, - class, - arguments, + Class, + Arguments, } } @@ -38,14 +38,14 @@ func (n New) Walk(v node.Visitor) { return } - if n.class != nil { - vv := v.GetChildrenVisitor("class") - n.class.Walk(vv) + if n.Class != nil { + vv := v.GetChildrenVisitor("Class") + n.Class.Walk(vv) } - if n.arguments != nil { - vv := v.GetChildrenVisitor("arguments") - for _, nn := range n.arguments { + if n.Arguments != nil { + vv := v.GetChildrenVisitor("Arguments") + for _, nn := range n.Arguments { nn.Walk(vv) } } diff --git a/node/expr/post_dec.go b/node/expr/post_dec.go index 86b2f29..9d0078d 100644 --- a/node/expr/post_dec.go +++ b/node/expr/post_dec.go @@ -7,14 +7,14 @@ import ( type PostDec struct { attributes map[string]interface{} position *node.Position - variable node.Node + Variable node.Node } -func NewPostDec(variable node.Node) node.Node { +func NewPostDec(Variable node.Node) node.Node { return &PostDec{ map[string]interface{}{}, nil, - variable, + Variable, } } @@ -36,9 +36,9 @@ func (n PostDec) Walk(v node.Visitor) { return } - if n.variable != nil { - vv := v.GetChildrenVisitor("variable") - n.variable.Walk(vv) + if n.Variable != nil { + vv := v.GetChildrenVisitor("Variable") + n.Variable.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/post_inc.go b/node/expr/post_inc.go index f88c8d9..2a1e0dd 100644 --- a/node/expr/post_inc.go +++ b/node/expr/post_inc.go @@ -7,14 +7,14 @@ import ( type PostInc struct { attributes map[string]interface{} position *node.Position - variable node.Node + Variable node.Node } -func NewPostInc(variable node.Node) node.Node { +func NewPostInc(Variable node.Node) node.Node { return &PostInc{ map[string]interface{}{}, nil, - variable, + Variable, } } @@ -36,9 +36,9 @@ func (n PostInc) Walk(v node.Visitor) { return } - if n.variable != nil { - vv := v.GetChildrenVisitor("variable") - n.variable.Walk(vv) + if n.Variable != nil { + vv := v.GetChildrenVisitor("Variable") + n.Variable.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/pre_dec.go b/node/expr/pre_dec.go index c6e5615..6514ee9 100644 --- a/node/expr/pre_dec.go +++ b/node/expr/pre_dec.go @@ -7,14 +7,14 @@ import ( type PreDec struct { attributes map[string]interface{} position *node.Position - variable node.Node + Variable node.Node } -func NewPreDec(variable node.Node) node.Node { +func NewPreDec(Variable node.Node) node.Node { return &PreDec{ map[string]interface{}{}, nil, - variable, + Variable, } } @@ -36,9 +36,9 @@ func (n PreDec) Walk(v node.Visitor) { return } - if n.variable != nil { - vv := v.GetChildrenVisitor("variable") - n.variable.Walk(vv) + if n.Variable != nil { + vv := v.GetChildrenVisitor("Variable") + n.Variable.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/pre_inc.go b/node/expr/pre_inc.go index 639870b..e0c3d12 100644 --- a/node/expr/pre_inc.go +++ b/node/expr/pre_inc.go @@ -7,14 +7,14 @@ import ( type PreInc struct { attributes map[string]interface{} position *node.Position - variable node.Node + Variable node.Node } -func NewPreInc(variable node.Node) node.Node { +func NewPreInc(Variable node.Node) node.Node { return &PreInc{ map[string]interface{}{}, nil, - variable, + Variable, } } @@ -36,9 +36,9 @@ func (n PreInc) Walk(v node.Visitor) { return } - if n.variable != nil { - vv := v.GetChildrenVisitor("variable") - n.variable.Walk(vv) + if n.Variable != nil { + vv := v.GetChildrenVisitor("Variable") + n.Variable.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/print.go b/node/expr/print.go index e2e5ceb..140d270 100644 --- a/node/expr/print.go +++ b/node/expr/print.go @@ -10,11 +10,11 @@ type Print struct { expr node.Node } -func NewPrint(expression node.Node) node.Node { +func NewPrint(Expression node.Node) node.Node { return &Print{ map[string]interface{}{}, nil, - expression, + Expression, } } diff --git a/node/expr/property_fetch.go b/node/expr/property_fetch.go index fc6445c..78f537c 100644 --- a/node/expr/property_fetch.go +++ b/node/expr/property_fetch.go @@ -7,16 +7,16 @@ import ( type PropertyFetch struct { attributes map[string]interface{} position *node.Position - variable node.Node - property node.Node + Variable node.Node + Property node.Node } -func NewPropertyFetch(variable node.Node, property node.Node) node.Node { +func NewPropertyFetch(Variable node.Node, Property node.Node) node.Node { return &PropertyFetch{ map[string]interface{}{}, nil, - variable, - property, + Variable, + Property, } } @@ -38,14 +38,14 @@ func (n PropertyFetch) Walk(v node.Visitor) { return } - if n.variable != nil { - vv := v.GetChildrenVisitor("variable") - n.variable.Walk(vv) + if n.Variable != nil { + vv := v.GetChildrenVisitor("Variable") + n.Variable.Walk(vv) } - if n.property != nil { - vv := v.GetChildrenVisitor("property") - n.property.Walk(vv) + if n.Property != nil { + vv := v.GetChildrenVisitor("Property") + n.Property.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/require.go b/node/expr/require.go index fb1a0ee..f3928ca 100644 --- a/node/expr/require.go +++ b/node/expr/require.go @@ -10,11 +10,11 @@ type Require struct { expr node.Node } -func NewRequire(expression node.Node) node.Node { +func NewRequire(Expression node.Node) node.Node { return &Require{ map[string]interface{}{}, nil, - expression, + Expression, } } diff --git a/node/expr/require_once.go b/node/expr/require_once.go index 99f04c4..d678859 100644 --- a/node/expr/require_once.go +++ b/node/expr/require_once.go @@ -10,11 +10,11 @@ type RequireOnce struct { expr node.Node } -func NewRequireOnce(expression node.Node) node.Node { +func NewRequireOnce(Expression node.Node) node.Node { return &RequireOnce{ map[string]interface{}{}, nil, - expression, + Expression, } } diff --git a/node/expr/shell_exec.go b/node/expr/shell_exec.go index 4adb16a..df4cc07 100644 --- a/node/expr/shell_exec.go +++ b/node/expr/shell_exec.go @@ -7,14 +7,14 @@ import ( type ShellExec struct { attributes map[string]interface{} position *node.Position - parts []node.Node + Parts []node.Node } -func NewShellExec(parts []node.Node) node.Node { +func NewShellExec(Parts []node.Node) node.Node { return &ShellExec{ map[string]interface{}{}, nil, - parts, + Parts, } } @@ -36,9 +36,9 @@ func (n ShellExec) Walk(v node.Visitor) { return } - if n.parts != nil { - vv := v.GetChildrenVisitor("parts") - for _, nn := range n.parts { + if n.Parts != nil { + vv := v.GetChildrenVisitor("Parts") + for _, nn := range n.Parts { nn.Walk(vv) } } diff --git a/node/expr/short_array.go b/node/expr/short_array.go index 50f6601..64379bb 100644 --- a/node/expr/short_array.go +++ b/node/expr/short_array.go @@ -7,14 +7,14 @@ import ( type ShortArray struct { attributes map[string]interface{} position *node.Position - items []node.Node + Items []node.Node } -func NewShortArray(items []node.Node) node.Node { +func NewShortArray(Items []node.Node) node.Node { return &ShortArray{ map[string]interface{}{}, nil, - items, + Items, } } @@ -36,9 +36,9 @@ func (n ShortArray) Walk(v node.Visitor) { return } - if n.items != nil { - vv := v.GetChildrenVisitor("items") - for _, nn := range n.items { + if n.Items != nil { + vv := v.GetChildrenVisitor("Items") + for _, nn := range n.Items { nn.Walk(vv) } } diff --git a/node/expr/short_list.go b/node/expr/short_list.go index 079f952..14f121f 100644 --- a/node/expr/short_list.go +++ b/node/expr/short_list.go @@ -7,14 +7,14 @@ import ( type ShortList struct { attributes map[string]interface{} position *node.Position - items []node.Node + Items []node.Node } -func NewShortList(items []node.Node) node.Node { +func NewShortList(Items []node.Node) node.Node { return &ShortList{ map[string]interface{}{}, nil, - items, + Items, } } @@ -36,9 +36,9 @@ func (n ShortList) Walk(v node.Visitor) { return } - if n.items != nil { - vv := v.GetChildrenVisitor("items") - for _, nn := range n.items { + if n.Items != nil { + vv := v.GetChildrenVisitor("Items") + for _, nn := range n.Items { nn.Walk(vv) } } diff --git a/node/expr/static_call.go b/node/expr/static_call.go index 6183951..aa2fdb8 100644 --- a/node/expr/static_call.go +++ b/node/expr/static_call.go @@ -7,18 +7,18 @@ import ( type StaticCall struct { attributes map[string]interface{} position *node.Position - class node.Node - call node.Node - arguments []node.Node + Class node.Node + Call node.Node + Arguments []node.Node } -func NewStaticCall(class node.Node, call node.Node, arguments []node.Node) node.Node { +func NewStaticCall(Class node.Node, Call node.Node, Arguments []node.Node) node.Node { return &StaticCall{ map[string]interface{}{}, nil, - class, - call, - arguments, + Class, + Call, + Arguments, } } @@ -40,19 +40,19 @@ func (n StaticCall) Walk(v node.Visitor) { return } - if n.class != nil { - vv := v.GetChildrenVisitor("class") - n.class.Walk(vv) + if n.Class != nil { + vv := v.GetChildrenVisitor("Class") + n.Class.Walk(vv) } - if n.call != nil { - vv := v.GetChildrenVisitor("call") - n.call.Walk(vv) + if n.Call != nil { + vv := v.GetChildrenVisitor("Call") + n.Call.Walk(vv) } - if n.arguments != nil { - vv := v.GetChildrenVisitor("arguments") - for _, nn := range n.arguments { + if n.Arguments != nil { + vv := v.GetChildrenVisitor("Arguments") + for _, nn := range n.Arguments { nn.Walk(vv) } } diff --git a/node/expr/static_property_fetch.go b/node/expr/static_property_fetch.go index 6fab554..030e917 100644 --- a/node/expr/static_property_fetch.go +++ b/node/expr/static_property_fetch.go @@ -7,16 +7,16 @@ import ( type StaticPropertyFetch struct { attributes map[string]interface{} position *node.Position - class node.Node - property node.Node + Class node.Node + Property node.Node } -func NewStaticPropertyFetch(class node.Node, property node.Node) node.Node { +func NewStaticPropertyFetch(Class node.Node, Property node.Node) node.Node { return &StaticPropertyFetch{ map[string]interface{}{}, nil, - class, - property, + Class, + Property, } } @@ -38,14 +38,14 @@ func (n StaticPropertyFetch) Walk(v node.Visitor) { return } - if n.class != nil { - vv := v.GetChildrenVisitor("class") - n.class.Walk(vv) + if n.Class != nil { + vv := v.GetChildrenVisitor("Class") + n.Class.Walk(vv) } - if n.property != nil { - vv := v.GetChildrenVisitor("property") - n.property.Walk(vv) + if n.Property != nil { + vv := v.GetChildrenVisitor("Property") + n.Property.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/ternary.go b/node/expr/ternary.go index 56984a5..77d44eb 100644 --- a/node/expr/ternary.go +++ b/node/expr/ternary.go @@ -7,18 +7,18 @@ import ( type Ternary struct { attributes map[string]interface{} position *node.Position - condition node.Node - ifTrue node.Node - ifFalse node.Node + Condition node.Node + IfTrue node.Node + IfFalse node.Node } -func NewTernary(condition node.Node, ifTrue node.Node, ifFalse node.Node) node.Node { +func NewTernary(Condition node.Node, IfTrue node.Node, IfFalse node.Node) node.Node { return &Ternary{ map[string]interface{}{}, nil, - condition, - ifTrue, - ifFalse, + Condition, + IfTrue, + IfFalse, } } @@ -40,19 +40,19 @@ func (n Ternary) Walk(v node.Visitor) { return } - if n.condition != nil { - vv := v.GetChildrenVisitor("condition") - n.condition.Walk(vv) + if n.Condition != nil { + vv := v.GetChildrenVisitor("Condition") + n.Condition.Walk(vv) } - if n.ifTrue != nil { - vv := v.GetChildrenVisitor("ifTrue") - n.ifTrue.Walk(vv) + if n.IfTrue != nil { + vv := v.GetChildrenVisitor("IfTrue") + n.IfTrue.Walk(vv) } - if n.ifFalse != nil { - vv := v.GetChildrenVisitor("ifFalse") - n.ifFalse.Walk(vv) + if n.IfFalse != nil { + vv := v.GetChildrenVisitor("IfFalse") + n.IfFalse.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/unary_minus.go b/node/expr/unary_minus.go index 038fea4..5562508 100644 --- a/node/expr/unary_minus.go +++ b/node/expr/unary_minus.go @@ -10,11 +10,11 @@ type UnaryMinus struct { expr node.Node } -func NewUnaryMinus(expression node.Node) node.Node { +func NewUnaryMinus(Expression node.Node) node.Node { return &UnaryMinus{ map[string]interface{}{}, nil, - expression, + Expression, } } diff --git a/node/expr/unary_plus.go b/node/expr/unary_plus.go index 584a2b5..4341926 100644 --- a/node/expr/unary_plus.go +++ b/node/expr/unary_plus.go @@ -10,11 +10,11 @@ type UnaryPlus struct { expr node.Node } -func NewUnaryPlus(expression node.Node) node.Node { +func NewUnaryPlus(Expression node.Node) node.Node { return &UnaryPlus{ map[string]interface{}{}, nil, - expression, + Expression, } } diff --git a/node/expr/variable.go b/node/expr/variable.go index b5b3180..4747b58 100644 --- a/node/expr/variable.go +++ b/node/expr/variable.go @@ -7,14 +7,14 @@ import ( type Variable struct { attributes map[string]interface{} position *node.Position - varName node.Node + VarName node.Node } -func NewVariable(varName node.Node) node.Node { +func NewVariable(VarName node.Node) node.Node { return &Variable{ map[string]interface{}{}, nil, - varName, + VarName, } } @@ -36,9 +36,9 @@ func (n Variable) Walk(v node.Visitor) { return } - if n.varName != nil { - vv := v.GetChildrenVisitor("varName") - n.varName.Walk(vv) + if n.VarName != nil { + vv := v.GetChildrenVisitor("VarName") + n.VarName.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/yield.go b/node/expr/yield.go index 5921d3c..5e298a4 100644 --- a/node/expr/yield.go +++ b/node/expr/yield.go @@ -7,16 +7,16 @@ import ( type Yield struct { attributes map[string]interface{} position *node.Position - key node.Node - value node.Node + Key node.Node + Value node.Node } -func NewYield(key node.Node, value node.Node) node.Node { +func NewYield(Key node.Node, Value node.Node) node.Node { return &Yield{ map[string]interface{}{}, nil, - key, - value, + Key, + Value, } } @@ -38,14 +38,14 @@ func (n Yield) Walk(v node.Visitor) { return } - if n.key != nil { - vv := v.GetChildrenVisitor("key") - n.key.Walk(vv) + if n.Key != nil { + vv := v.GetChildrenVisitor("Key") + n.Key.Walk(vv) } - if n.value != nil { - vv := v.GetChildrenVisitor("value") - n.value.Walk(vv) + if n.Value != nil { + vv := v.GetChildrenVisitor("Value") + n.Value.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/yield_from.go b/node/expr/yield_from.go index 561e230..839ad88 100644 --- a/node/expr/yield_from.go +++ b/node/expr/yield_from.go @@ -10,11 +10,11 @@ type YieldFrom struct { expr node.Node } -func NewYieldFrom(expression node.Node) node.Node { +func NewYieldFrom(Expression node.Node) node.Node { return &YieldFrom{ map[string]interface{}{}, nil, - expression, + Expression, } } diff --git a/node/identifier.go b/node/identifier.go index dd219e8..969f765 100644 --- a/node/identifier.go +++ b/node/identifier.go @@ -12,7 +12,7 @@ type Identifier struct { func NewIdentifier(token token.Token) Node { return &Identifier{ map[string]interface{}{ - "value": token.Value, + "Value": token.Value, }, nil, } @@ -22,12 +22,12 @@ func (n Identifier) Attributes() map[string]interface{} { return n.attributes } -func (n Identifier) Attribute(key string) interface{} { - return n.attributes[key] +func (n Identifier) Attribute(Key string) interface{} { + return n.attributes[Key] } -func (n Identifier) SetAttribute(key string, value interface{}) Node { - n.attributes[key] = value +func (n Identifier) SetAttribute(Key string, Value interface{}) Node { + n.attributes[Key] = Value return n } diff --git a/node/name/fully_qualified.go b/node/name/fully_qualified.go index 8a925fb..64d4de5 100644 --- a/node/name/fully_qualified.go +++ b/node/name/fully_qualified.go @@ -8,12 +8,12 @@ type FullyQualified struct { Name } -func NewFullyQualified(parts []node.Node) node.Node { +func NewFullyQualified(Parts []node.Node) node.Node { return &FullyQualified{ Name{ map[string]interface{}{}, nil, - parts, + Parts, }, } } diff --git a/node/name/name.go b/node/name/name.go index 7333708..f214810 100644 --- a/node/name/name.go +++ b/node/name/name.go @@ -7,14 +7,14 @@ import ( type Name struct { attributes map[string]interface{} position *node.Position - parts []node.Node + Parts []node.Node } -func NewName(parts []node.Node) node.Node { +func NewName(Parts []node.Node) node.Node { return &Name{ map[string]interface{}{}, nil, - parts, + Parts, } } @@ -36,9 +36,9 @@ func (n Name) Walk(v node.Visitor) { return } - if n.parts != nil { - vv := v.GetChildrenVisitor("parts") - for _, nn := range n.parts { + if n.Parts != nil { + vv := v.GetChildrenVisitor("Parts") + for _, nn := range n.Parts { nn.Walk(vv) } } diff --git a/node/name/name_part.go b/node/name/name_part.go index 10d876e..9e5fc2e 100644 --- a/node/name/name_part.go +++ b/node/name/name_part.go @@ -9,10 +9,10 @@ type NamePart struct { position *node.Position } -func NewNamePart(value string) node.Node { +func NewNamePart(Value string) node.Node { return &NamePart{ map[string]interface{}{ - "value": value, + "Value": Value, }, nil, } diff --git a/node/name/relative.go b/node/name/relative.go index 30048c1..3139aa5 100644 --- a/node/name/relative.go +++ b/node/name/relative.go @@ -8,12 +8,12 @@ type Relative struct { Name } -func NewRelative(parts []node.Node) node.Node { +func NewRelative(Parts []node.Node) node.Node { return &Relative{ Name{ map[string]interface{}{}, nil, - parts, + Parts, }, } } diff --git a/node/nullable.go b/node/nullable.go index 4786611..73b649e 100644 --- a/node/nullable.go +++ b/node/nullable.go @@ -6,11 +6,11 @@ type Nullable struct { expr Node } -func NewNullable(expression Node) Node { +func NewNullable(Expression Node) Node { return &Nullable{ map[string]interface{}{}, nil, - expression, + Expression, } } @@ -18,12 +18,12 @@ func (n Nullable) Attributes() map[string]interface{} { return n.attributes } -func (n Nullable) Attribute(key string) interface{} { - return n.attributes[key] +func (n Nullable) Attribute(Key string) interface{} { + return n.attributes[Key] } -func (n Nullable) SetAttribute(key string, value interface{}) Node { - n.attributes[key] = value +func (n Nullable) SetAttribute(Key string, Value interface{}) Node { + n.attributes[Key] = Value return n } diff --git a/node/parameter.go b/node/parameter.go index a746e31..0908e68 100644 --- a/node/parameter.go +++ b/node/parameter.go @@ -3,21 +3,21 @@ package node type Parameter struct { attributes map[string]interface{} position *Position - variableType Node - variable Node - defaultValue Node + VariableType Node + Variable Node + DefaultValue Node } -func NewParameter(variableType Node, variable Node, defaultValue Node, byRef bool, variadic bool) Node { +func NewParameter(VariableType Node, Variable Node, DefaultValue Node, byRef bool, variadic bool) Node { return &Parameter{ map[string]interface{}{ "byRef": byRef, "variadic": variadic, }, nil, - variableType, - variable, - defaultValue, + VariableType, + Variable, + DefaultValue, } } @@ -25,12 +25,12 @@ func (n Parameter) Attributes() map[string]interface{} { return n.attributes } -func (n Parameter) Attribute(key string) interface{} { - return n.attributes[key] +func (n Parameter) Attribute(Key string) interface{} { + return n.attributes[Key] } -func (n Parameter) SetAttribute(key string, value interface{}) Node { - n.attributes[key] = value +func (n Parameter) SetAttribute(Key string, Value interface{}) Node { + n.attributes[Key] = Value return n } @@ -48,19 +48,19 @@ func (n Parameter) Walk(v Visitor) { return } - if n.variableType != nil { - vv := v.GetChildrenVisitor("variableType") - n.variableType.Walk(vv) + if n.VariableType != nil { + vv := v.GetChildrenVisitor("VariableType") + n.VariableType.Walk(vv) } - if n.variable != nil { - vv := v.GetChildrenVisitor("variable") - n.variable.Walk(vv) + if n.Variable != nil { + vv := v.GetChildrenVisitor("Variable") + n.Variable.Walk(vv) } - if n.defaultValue != nil { - vv := v.GetChildrenVisitor("defaultValue") - n.defaultValue.Walk(vv) + if n.DefaultValue != nil { + vv := v.GetChildrenVisitor("DefaultValue") + n.DefaultValue.Walk(vv) } v.LeaveNode(n) diff --git a/node/scalar/dnumber.go b/node/scalar/dnumber.go index b5ccc48..f1c0182 100644 --- a/node/scalar/dnumber.go +++ b/node/scalar/dnumber.go @@ -9,10 +9,10 @@ type Dnumber struct { position *node.Position } -func NewDnumber(value string) node.Node { +func NewDnumber(Value string) node.Node { return &Dnumber{ map[string]interface{}{ - "value": value, + "Value": Value, }, nil, } diff --git a/node/scalar/encapsed.go b/node/scalar/encapsed.go index ce0c1fd..8408e7b 100644 --- a/node/scalar/encapsed.go +++ b/node/scalar/encapsed.go @@ -7,14 +7,14 @@ import ( type Encapsed struct { attributes map[string]interface{} position *node.Position - parts []node.Node + Parts []node.Node } -func NewEncapsed(parts []node.Node) node.Node { +func NewEncapsed(Parts []node.Node) node.Node { return &Encapsed{ map[string]interface{}{}, nil, - parts, + Parts, } } @@ -36,9 +36,9 @@ func (n Encapsed) Walk(v node.Visitor) { return } - if n.parts != nil { - vv := v.GetChildrenVisitor("parts") - for _, nn := range n.parts { + if n.Parts != nil { + vv := v.GetChildrenVisitor("Parts") + for _, nn := range n.Parts { nn.Walk(vv) } } diff --git a/node/scalar/encapsed_string_part.go b/node/scalar/encapsed_string_part.go index a46d921..5079f6d 100644 --- a/node/scalar/encapsed_string_part.go +++ b/node/scalar/encapsed_string_part.go @@ -9,10 +9,10 @@ type EncapsedStringPart struct { position *node.Position } -func NewEncapsedStringPart(value string) node.Node { +func NewEncapsedStringPart(Value string) node.Node { return &EncapsedStringPart{ map[string]interface{}{ - "value": value, + "Value": Value, }, nil, } diff --git a/node/scalar/lnumber.go b/node/scalar/lnumber.go index 5fddfe1..822420d 100644 --- a/node/scalar/lnumber.go +++ b/node/scalar/lnumber.go @@ -9,10 +9,10 @@ type Lnumber struct { position *node.Position } -func NewLnumber(value string) node.Node { +func NewLnumber(Value string) node.Node { return &Lnumber{ map[string]interface{}{ - "value": value, + "Value": Value, }, nil, } diff --git a/node/scalar/magic_constant.go b/node/scalar/magic_constant.go index 4aea514..37d7e3b 100644 --- a/node/scalar/magic_constant.go +++ b/node/scalar/magic_constant.go @@ -9,10 +9,10 @@ type MagicConstant struct { position *node.Position } -func NewMagicConstant(value string) node.Node { +func NewMagicConstant(Value string) node.Node { return &MagicConstant{ map[string]interface{}{ - "value": value, + "Value": Value, }, nil, } diff --git a/node/scalar/string.go b/node/scalar/string.go index f2a8ef3..647ea68 100644 --- a/node/scalar/string.go +++ b/node/scalar/string.go @@ -9,10 +9,10 @@ type String struct { position *node.Position } -func NewString(value string) node.Node { +func NewString(Value string) node.Node { return &String{ map[string]interface{}{ - "value": value, + "Value": Value, }, nil, } diff --git a/node/stmt/alt_else.go b/node/stmt/alt_else.go index 66540d4..7a666ae 100644 --- a/node/stmt/alt_else.go +++ b/node/stmt/alt_else.go @@ -7,14 +7,14 @@ import ( type AltElse struct { attributes map[string]interface{} position *node.Position - stmt node.Node + Stmt node.Node } -func NewAltElse(stmt node.Node) node.Node { +func NewAltElse(Stmt node.Node) node.Node { return &AltElse{ map[string]interface{}{}, nil, - stmt, + Stmt, } } @@ -36,9 +36,9 @@ func (n AltElse) Walk(v node.Visitor) { return } - if n.stmt != nil { - vv := v.GetChildrenVisitor("stmt") - n.stmt.Walk(vv) + if n.Stmt != nil { + vv := v.GetChildrenVisitor("Stmt") + n.Stmt.Walk(vv) } v.LeaveNode(n) diff --git a/node/stmt/alt_else_if.go b/node/stmt/alt_else_if.go index 362a31c..4a1c720 100644 --- a/node/stmt/alt_else_if.go +++ b/node/stmt/alt_else_if.go @@ -7,16 +7,16 @@ import ( type AltElseIf struct { attributes map[string]interface{} position *node.Position - cond node.Node - stmt node.Node + Cond node.Node + Stmt node.Node } -func NewAltElseIf(cond node.Node, stmt node.Node) node.Node { +func NewAltElseIf(Cond node.Node, Stmt node.Node) node.Node { return &AltElseIf{ map[string]interface{}{}, nil, - cond, - stmt, + Cond, + Stmt, } } @@ -38,14 +38,14 @@ func (n AltElseIf) Walk(v node.Visitor) { return } - if n.cond != nil { - vv := v.GetChildrenVisitor("cond") - n.cond.Walk(vv) + if n.Cond != nil { + vv := v.GetChildrenVisitor("Cond") + n.Cond.Walk(vv) } - if n.stmt != nil { - vv := v.GetChildrenVisitor("stmt") - n.stmt.Walk(vv) + if n.Stmt != nil { + vv := v.GetChildrenVisitor("Stmt") + n.Stmt.Walk(vv) } v.LeaveNode(n) diff --git a/node/stmt/alt_if.go b/node/stmt/alt_if.go index 82ca6c7..2c21282 100644 --- a/node/stmt/alt_if.go +++ b/node/stmt/alt_if.go @@ -7,18 +7,18 @@ import ( type AltIf struct { attributes map[string]interface{} position *node.Position - cond node.Node - stmt node.Node - elseIf []node.Node + Cond node.Node + Stmt node.Node + ElseIf []node.Node _else node.Node } -func NewAltIf(cond node.Node, stmt node.Node) node.Node { +func NewAltIf(Cond node.Node, Stmt node.Node) node.Node { return &AltIf{ map[string]interface{}{}, nil, - cond, - stmt, + Cond, + Stmt, nil, nil, } @@ -37,12 +37,12 @@ func (n AltIf) SetPosition(p *node.Position) node.Node { return n } -func (n AltIf) AddElseIf(elseIf node.Node) node.Node { - if n.elseIf == nil { - n.elseIf = make([]node.Node, 0) +func (n AltIf) AddElseIf(ElseIf node.Node) node.Node { + if n.ElseIf == nil { + n.ElseIf = make([]node.Node, 0) } - n.elseIf = append(n.elseIf, elseIf) + n.ElseIf = append(n.ElseIf, ElseIf) return n } @@ -58,19 +58,19 @@ func (n AltIf) Walk(v node.Visitor) { return } - if n.cond != nil { - vv := v.GetChildrenVisitor("cond") - n.cond.Walk(vv) + if n.Cond != nil { + vv := v.GetChildrenVisitor("Cond") + n.Cond.Walk(vv) } - if n.stmt != nil { - vv := v.GetChildrenVisitor("stmt") - n.stmt.Walk(vv) + if n.Stmt != nil { + vv := v.GetChildrenVisitor("Stmt") + n.Stmt.Walk(vv) } - if n.elseIf != nil { - vv := v.GetChildrenVisitor("elseIf") - for _, nn := range n.elseIf { + if n.ElseIf != nil { + vv := v.GetChildrenVisitor("ElseIf") + for _, nn := range n.ElseIf { nn.Walk(vv) } } diff --git a/node/stmt/case.go b/node/stmt/case.go index f703381..39ae950 100644 --- a/node/stmt/case.go +++ b/node/stmt/case.go @@ -7,16 +7,16 @@ import ( type Case struct { attributes map[string]interface{} position *node.Position - cond node.Node - stmts []node.Node + Cond node.Node + Stmts []node.Node } -func NewCase(cond node.Node, stmts []node.Node) node.Node { +func NewCase(Cond node.Node, Stmts []node.Node) node.Node { return &Case{ map[string]interface{}{}, nil, - cond, - stmts, + Cond, + Stmts, } } @@ -38,14 +38,14 @@ func (n Case) Walk(v node.Visitor) { return } - if n.cond != nil { - vv := v.GetChildrenVisitor("cond") - n.cond.Walk(vv) + if n.Cond != nil { + vv := v.GetChildrenVisitor("Cond") + n.Cond.Walk(vv) } - if n.stmts != nil { - vv := v.GetChildrenVisitor("stmts") - for _, nn := range n.stmts { + if n.Stmts != nil { + vv := v.GetChildrenVisitor("Stmts") + for _, nn := range n.Stmts { nn.Walk(vv) } } diff --git a/node/stmt/catch.go b/node/stmt/catch.go index ba39382..28ade5c 100644 --- a/node/stmt/catch.go +++ b/node/stmt/catch.go @@ -7,18 +7,18 @@ import ( type Catch struct { attributes map[string]interface{} position *node.Position - types []node.Node - variable node.Node - stmts []node.Node + Types []node.Node + Variable node.Node + Stmts []node.Node } -func NewCatch(types []node.Node, variable node.Node, stmts []node.Node) node.Node { +func NewCatch(Types []node.Node, Variable node.Node, Stmts []node.Node) node.Node { return &Catch{ map[string]interface{}{}, nil, - types, - variable, - stmts, + Types, + Variable, + Stmts, } } @@ -40,16 +40,16 @@ func (n Catch) Walk(v node.Visitor) { return } - if n.types != nil { - vv := v.GetChildrenVisitor("types") - for _, nn := range n.types { + if n.Types != nil { + vv := v.GetChildrenVisitor("Types") + for _, nn := range n.Types { nn.Walk(vv) } } - if n.stmts != nil { - vv := v.GetChildrenVisitor("stmts") - for _, nn := range n.stmts { + if n.Stmts != nil { + vv := v.GetChildrenVisitor("Stmts") + for _, nn := range n.Stmts { nn.Walk(vv) } } diff --git a/node/stmt/class.go b/node/stmt/class.go index b60f343..851936c 100644 --- a/node/stmt/class.go +++ b/node/stmt/class.go @@ -7,26 +7,26 @@ import ( type Class struct { attributes map[string]interface{} position *node.Position - className node.Node - modifiers []node.Node + ClassName node.Node + Modifiers []node.Node args []node.Node - extends node.Node - implements []node.Node - stmts []node.Node + Extends node.Node + Implements []node.Node + Stmts []node.Node } -func NewClass(className node.Node, modifiers []node.Node, args []node.Node, extends node.Node, implements []node.Node, stmts []node.Node, phpDocComment string) node.Node { +func NewClass(ClassName node.Node, Modifiers []node.Node, args []node.Node, Extends node.Node, Implements []node.Node, Stmts []node.Node, phpDocComment string) node.Node { return &Class{ map[string]interface{}{ "phpDocComment": phpDocComment, }, nil, - className, - modifiers, + ClassName, + Modifiers, args, - extends, - implements, - stmts, + Extends, + Implements, + Stmts, } } @@ -48,14 +48,14 @@ func (n Class) Walk(v node.Visitor) { return } - if n.className != nil { - vv := v.GetChildrenVisitor("className") - n.className.Walk(vv) + if n.ClassName != nil { + vv := v.GetChildrenVisitor("ClassName") + n.ClassName.Walk(vv) } - if n.modifiers != nil { - vv := v.GetChildrenVisitor("modifiers") - for _, nn := range n.modifiers { + if n.Modifiers != nil { + vv := v.GetChildrenVisitor("Modifiers") + for _, nn := range n.Modifiers { nn.Walk(vv) } } @@ -67,21 +67,21 @@ func (n Class) Walk(v node.Visitor) { } } - if n.extends != nil { - vv := v.GetChildrenVisitor("extends") - n.extends.Walk(vv) + if n.Extends != nil { + vv := v.GetChildrenVisitor("Extends") + n.Extends.Walk(vv) } - if n.implements != nil { - vv := v.GetChildrenVisitor("implements") - for _, nn := range n.implements { + if n.Implements != nil { + vv := v.GetChildrenVisitor("Implements") + for _, nn := range n.Implements { nn.Walk(vv) } } - if n.stmts != nil { - vv := v.GetChildrenVisitor("stmts") - for _, nn := range n.stmts { + if n.Stmts != nil { + vv := v.GetChildrenVisitor("Stmts") + for _, nn := range n.Stmts { nn.Walk(vv) } } diff --git a/node/stmt/class_const_list.go b/node/stmt/class_const_list.go index b397967..f4a0afd 100644 --- a/node/stmt/class_const_list.go +++ b/node/stmt/class_const_list.go @@ -7,16 +7,16 @@ import ( type ClassConstList struct { attributes map[string]interface{} position *node.Position - modifiers []node.Node - consts []node.Node + Modifiers []node.Node + Consts []node.Node } -func NewClassConstList(modifiers []node.Node, consts []node.Node) node.Node { +func NewClassConstList(Modifiers []node.Node, Consts []node.Node) node.Node { return &ClassConstList{ map[string]interface{}{}, nil, - modifiers, - consts, + Modifiers, + Consts, } } @@ -38,16 +38,16 @@ func (n ClassConstList) Walk(v node.Visitor) { return } - if n.modifiers != nil { - vv := v.GetChildrenVisitor("modifiers") - for _, nn := range n.modifiers { + if n.Modifiers != nil { + vv := v.GetChildrenVisitor("Modifiers") + for _, nn := range n.Modifiers { nn.Walk(vv) } } - if n.consts != nil { - vv := v.GetChildrenVisitor("consts") - for _, nn := range n.consts { + if n.Consts != nil { + vv := v.GetChildrenVisitor("Consts") + for _, nn := range n.Consts { nn.Walk(vv) } } diff --git a/node/stmt/class_method.go b/node/stmt/class_method.go index c662b22..6ca3b07 100644 --- a/node/stmt/class_method.go +++ b/node/stmt/class_method.go @@ -7,25 +7,25 @@ import ( type ClassMethod struct { attributes map[string]interface{} position *node.Position - methodName node.Node - modifiers []node.Node - params []node.Node - returnType node.Node - stmts []node.Node + MethodName node.Node + Modifiers []node.Node + Params []node.Node + ReturnType node.Node + Stmts []node.Node } -func NewClassMethod(methodName node.Node, modifiers []node.Node, returnsRef bool, params []node.Node, returnType node.Node, stmts []node.Node, phpDocComment string) node.Node { +func NewClassMethod(MethodName node.Node, Modifiers []node.Node, returnsRef bool, Params []node.Node, ReturnType node.Node, Stmts []node.Node, phpDocComment string) node.Node { return &ClassMethod{ map[string]interface{}{ "returnsRef": returnsRef, "phpDocComment": phpDocComment, }, nil, - methodName, - modifiers, - params, - returnType, - stmts, + MethodName, + Modifiers, + Params, + ReturnType, + Stmts, } } @@ -47,33 +47,33 @@ func (n ClassMethod) Walk(v node.Visitor) { return } - if n.methodName != nil { - vv := v.GetChildrenVisitor("methodName") - n.methodName.Walk(vv) + if n.MethodName != nil { + vv := v.GetChildrenVisitor("MethodName") + n.MethodName.Walk(vv) } - if n.modifiers != nil { - vv := v.GetChildrenVisitor("modifiers") - for _, nn := range n.modifiers { + if n.Modifiers != nil { + vv := v.GetChildrenVisitor("Modifiers") + for _, nn := range n.Modifiers { nn.Walk(vv) } } - if n.params != nil { - vv := v.GetChildrenVisitor("params") - for _, nn := range n.params { + if n.Params != nil { + vv := v.GetChildrenVisitor("Params") + for _, nn := range n.Params { nn.Walk(vv) } } - if n.returnType != nil { - vv := v.GetChildrenVisitor("returnType") - n.returnType.Walk(vv) + if n.ReturnType != nil { + vv := v.GetChildrenVisitor("ReturnType") + n.ReturnType.Walk(vv) } - if n.stmts != nil { - vv := v.GetChildrenVisitor("stmts") - for _, nn := range n.stmts { + if n.Stmts != nil { + vv := v.GetChildrenVisitor("Stmts") + for _, nn := range n.Stmts { nn.Walk(vv) } } diff --git a/node/stmt/const_list.go b/node/stmt/const_list.go index f6d050e..7fbba26 100644 --- a/node/stmt/const_list.go +++ b/node/stmt/const_list.go @@ -7,14 +7,14 @@ import ( type ConstList struct { attributes map[string]interface{} position *node.Position - consts []node.Node + Consts []node.Node } -func NewConstList(consts []node.Node) node.Node { +func NewConstList(Consts []node.Node) node.Node { return &ConstList{ map[string]interface{}{}, nil, - consts, + Consts, } } @@ -36,9 +36,9 @@ func (n ConstList) Walk(v node.Visitor) { return } - if n.consts != nil { - vv := v.GetChildrenVisitor("consts") - for _, nn := range n.consts { + if n.Consts != nil { + vv := v.GetChildrenVisitor("Consts") + for _, nn := range n.Consts { nn.Walk(vv) } } diff --git a/node/stmt/constant.go b/node/stmt/constant.go index 1538d6b..31a765e 100644 --- a/node/stmt/constant.go +++ b/node/stmt/constant.go @@ -7,17 +7,17 @@ import ( type Constant struct { attributes map[string]interface{} position *node.Position - constantName node.Node + ConstantName node.Node expr node.Node } -func NewConstant(constantName node.Node, expr node.Node, phpDocComment string) node.Node { +func NewConstant(ConstantName node.Node, expr node.Node, phpDocComment string) node.Node { return &Constant{ map[string]interface{}{ "phpDocComment": phpDocComment, }, nil, - constantName, + ConstantName, expr, } } @@ -40,9 +40,9 @@ func (n Constant) Walk(v node.Visitor) { return } - if n.constantName != nil { - vv := v.GetChildrenVisitor("constantName") - n.constantName.Walk(vv) + if n.ConstantName != nil { + vv := v.GetChildrenVisitor("ConstantName") + n.ConstantName.Walk(vv) } if n.expr != nil { diff --git a/node/stmt/declare.go b/node/stmt/declare.go index 8333ed4..28da683 100644 --- a/node/stmt/declare.go +++ b/node/stmt/declare.go @@ -7,16 +7,16 @@ import ( type Declare struct { attributes map[string]interface{} position *node.Position - consts []node.Node - stmt node.Node + Consts []node.Node + Stmt node.Node } -func NewDeclare(consts []node.Node, stmt node.Node) node.Node { +func NewDeclare(Consts []node.Node, Stmt node.Node) node.Node { return &Declare{ map[string]interface{}{}, nil, - consts, - stmt, + Consts, + Stmt, } } @@ -38,16 +38,16 @@ func (n Declare) Walk(v node.Visitor) { return } - if n.consts != nil { - vv := v.GetChildrenVisitor("consts") - for _, nn := range n.consts { + if n.Consts != nil { + vv := v.GetChildrenVisitor("Consts") + for _, nn := range n.Consts { nn.Walk(vv) } } - if n.stmt != nil { - vv := v.GetChildrenVisitor("stmt") - n.stmt.Walk(vv) + if n.Stmt != nil { + vv := v.GetChildrenVisitor("Stmt") + n.Stmt.Walk(vv) } v.LeaveNode(n) diff --git a/node/stmt/default.go b/node/stmt/default.go index 2f51111..896807d 100644 --- a/node/stmt/default.go +++ b/node/stmt/default.go @@ -7,14 +7,14 @@ import ( type Default struct { attributes map[string]interface{} position *node.Position - stmts []node.Node + Stmts []node.Node } -func NewDefault(stmts []node.Node) node.Node { +func NewDefault(Stmts []node.Node) node.Node { return &Default{ map[string]interface{}{}, nil, - stmts, + Stmts, } } @@ -36,9 +36,9 @@ func (n Default) Walk(v node.Visitor) { return } - if n.stmts != nil { - vv := v.GetChildrenVisitor("stmts") - for _, nn := range n.stmts { + if n.Stmts != nil { + vv := v.GetChildrenVisitor("Stmts") + for _, nn := range n.Stmts { nn.Walk(vv) } } diff --git a/node/stmt/do.go b/node/stmt/do.go index 5663d84..3af66a5 100644 --- a/node/stmt/do.go +++ b/node/stmt/do.go @@ -7,16 +7,16 @@ import ( type Do struct { attributes map[string]interface{} position *node.Position - stmt node.Node - cond node.Node + Stmt node.Node + Cond node.Node } -func NewDo(stmt node.Node, cond node.Node) node.Node { +func NewDo(Stmt node.Node, Cond node.Node) node.Node { return &Do{ map[string]interface{}{}, nil, - stmt, - cond, + Stmt, + Cond, } } @@ -38,14 +38,14 @@ func (n Do) Walk(v node.Visitor) { return } - if n.cond != nil { - vv := v.GetChildrenVisitor("cond") - n.cond.Walk(vv) + if n.Cond != nil { + vv := v.GetChildrenVisitor("Cond") + n.Cond.Walk(vv) } - if n.stmt != nil { - vv := v.GetChildrenVisitor("stmt") - n.stmt.Walk(vv) + if n.Stmt != nil { + vv := v.GetChildrenVisitor("Stmt") + n.Stmt.Walk(vv) } v.LeaveNode(n) diff --git a/node/stmt/echo.go b/node/stmt/echo.go index c6c03cc..79fb0ac 100644 --- a/node/stmt/echo.go +++ b/node/stmt/echo.go @@ -7,14 +7,14 @@ import ( type Echo struct { attributes map[string]interface{} position *node.Position - exprs []node.Node + Exprs []node.Node } -func NewEcho(exprs []node.Node) node.Node { +func NewEcho(Exprs []node.Node) node.Node { return &Echo{ map[string]interface{}{}, nil, - exprs, + Exprs, } } @@ -36,9 +36,9 @@ func (n Echo) Walk(v node.Visitor) { return } - if n.exprs != nil { - vv := v.GetChildrenVisitor("exprs") - for _, nn := range n.exprs { + if n.Exprs != nil { + vv := v.GetChildrenVisitor("Exprs") + for _, nn := range n.Exprs { nn.Walk(vv) } } diff --git a/node/stmt/else.go b/node/stmt/else.go index f800c26..9c43b25 100644 --- a/node/stmt/else.go +++ b/node/stmt/else.go @@ -7,14 +7,14 @@ import ( type Else struct { attributes map[string]interface{} position *node.Position - stmt node.Node + Stmt node.Node } -func NewElse(stmt node.Node) node.Node { +func NewElse(Stmt node.Node) node.Node { return &Else{ map[string]interface{}{}, nil, - stmt, + Stmt, } } @@ -36,9 +36,9 @@ func (n Else) Walk(v node.Visitor) { return } - if n.stmt != nil { - vv := v.GetChildrenVisitor("stmt") - n.stmt.Walk(vv) + if n.Stmt != nil { + vv := v.GetChildrenVisitor("Stmt") + n.Stmt.Walk(vv) } v.LeaveNode(n) diff --git a/node/stmt/else_if.go b/node/stmt/else_if.go index bca2d76..9b214ca 100644 --- a/node/stmt/else_if.go +++ b/node/stmt/else_if.go @@ -7,16 +7,16 @@ import ( type ElseIf struct { attributes map[string]interface{} position *node.Position - cond node.Node - stmt node.Node + Cond node.Node + Stmt node.Node } -func NewElseIf(cond node.Node, stmt node.Node) node.Node { +func NewElseIf(Cond node.Node, Stmt node.Node) node.Node { return &ElseIf{ map[string]interface{}{}, nil, - cond, - stmt, + Cond, + Stmt, } } @@ -38,14 +38,14 @@ func (n ElseIf) Walk(v node.Visitor) { return } - if n.cond != nil { - vv := v.GetChildrenVisitor("cond") - n.cond.Walk(vv) + if n.Cond != nil { + vv := v.GetChildrenVisitor("Cond") + n.Cond.Walk(vv) } - if n.stmt != nil { - vv := v.GetChildrenVisitor("stmt") - n.stmt.Walk(vv) + if n.Stmt != nil { + vv := v.GetChildrenVisitor("Stmt") + n.Stmt.Walk(vv) } v.LeaveNode(n) diff --git a/node/stmt/finally.go b/node/stmt/finally.go index 8c17dd6..2f54324 100644 --- a/node/stmt/finally.go +++ b/node/stmt/finally.go @@ -7,14 +7,14 @@ import ( type Finally struct { attributes map[string]interface{} position *node.Position - stmts []node.Node + Stmts []node.Node } -func NewFinally(stmts []node.Node) node.Node { +func NewFinally(Stmts []node.Node) node.Node { return &Finally{ map[string]interface{}{}, nil, - stmts, + Stmts, } } @@ -36,9 +36,9 @@ func (n Finally) Walk(v node.Visitor) { return } - if n.stmts != nil { - vv := v.GetChildrenVisitor("stmts") - for _, nn := range n.stmts { + if n.Stmts != nil { + vv := v.GetChildrenVisitor("Stmts") + for _, nn := range n.Stmts { nn.Walk(vv) } } diff --git a/node/stmt/for.go b/node/stmt/for.go index 93bc1cc..388691e 100644 --- a/node/stmt/for.go +++ b/node/stmt/for.go @@ -7,20 +7,20 @@ import ( type For struct { attributes map[string]interface{} position *node.Position - init []node.Node - cond []node.Node - loop []node.Node - stmt node.Node + Init []node.Node + Cond []node.Node + Loop []node.Node + Stmt node.Node } -func NewFor(init []node.Node, cond []node.Node, loop []node.Node, stmt node.Node) node.Node { +func NewFor(Init []node.Node, Cond []node.Node, Loop []node.Node, Stmt node.Node) node.Node { return &For{ map[string]interface{}{}, nil, - init, - cond, - loop, - stmt, + Init, + Cond, + Loop, + Stmt, } } @@ -42,30 +42,30 @@ func (n For) Walk(v node.Visitor) { return } - if n.init != nil { - vv := v.GetChildrenVisitor("init") - for _, nn := range n.init { + if n.Init != nil { + vv := v.GetChildrenVisitor("Init") + for _, nn := range n.Init { nn.Walk(vv) } } - if n.cond != nil { - vv := v.GetChildrenVisitor("cond") - for _, nn := range n.cond { + if n.Cond != nil { + vv := v.GetChildrenVisitor("Cond") + for _, nn := range n.Cond { nn.Walk(vv) } } - if n.loop != nil { - vv := v.GetChildrenVisitor("loop") - for _, nn := range n.loop { + if n.Loop != nil { + vv := v.GetChildrenVisitor("Loop") + for _, nn := range n.Loop { nn.Walk(vv) } } - if n.stmt != nil { - vv := v.GetChildrenVisitor("stmt") - n.stmt.Walk(vv) + if n.Stmt != nil { + vv := v.GetChildrenVisitor("Stmt") + n.Stmt.Walk(vv) } v.LeaveNode(n) diff --git a/node/stmt/foreach.go b/node/stmt/foreach.go index 2b046a1..1859cd9 100644 --- a/node/stmt/foreach.go +++ b/node/stmt/foreach.go @@ -8,21 +8,21 @@ type Foreach struct { attributes map[string]interface{} position *node.Position expr node.Node - key node.Node - variable node.Node - stmt node.Node + Key node.Node + Variable node.Node + Stmt node.Node } -func NewForeach(expr node.Node, key node.Node, variable node.Node, stmt node.Node, byRef bool) node.Node { +func NewForeach(expr node.Node, Key node.Node, Variable node.Node, Stmt node.Node, byRef bool) node.Node { return &Foreach{ map[string]interface{}{ "byRef": byRef, }, nil, expr, - key, - variable, - stmt, + Key, + Variable, + Stmt, } } @@ -49,19 +49,19 @@ func (n Foreach) Walk(v node.Visitor) { n.expr.Walk(vv) } - if n.key != nil { - vv := v.GetChildrenVisitor("key") - n.key.Walk(vv) + if n.Key != nil { + vv := v.GetChildrenVisitor("Key") + n.Key.Walk(vv) } - if n.variable != nil { - vv := v.GetChildrenVisitor("variable") - n.variable.Walk(vv) + if n.Variable != nil { + vv := v.GetChildrenVisitor("Variable") + n.Variable.Walk(vv) } - if n.stmt != nil { - vv := v.GetChildrenVisitor("stmt") - n.stmt.Walk(vv) + if n.Stmt != nil { + vv := v.GetChildrenVisitor("Stmt") + n.Stmt.Walk(vv) } v.LeaveNode(n) diff --git a/node/stmt/global.go b/node/stmt/global.go index f54d4b5..067f3d9 100644 --- a/node/stmt/global.go +++ b/node/stmt/global.go @@ -7,14 +7,14 @@ import ( type Global struct { attributes map[string]interface{} position *node.Position - vars []node.Node + Vars []node.Node } -func NewGlobal(vars []node.Node) node.Node { +func NewGlobal(Vars []node.Node) node.Node { return &Global{ map[string]interface{}{}, nil, - vars, + Vars, } } @@ -36,9 +36,9 @@ func (n Global) Walk(v node.Visitor) { return } - if n.vars != nil { - vv := v.GetChildrenVisitor("vars") - for _, nn := range n.vars { + if n.Vars != nil { + vv := v.GetChildrenVisitor("Vars") + for _, nn := range n.Vars { nn.Walk(vv) } } diff --git a/node/stmt/goto.go b/node/stmt/goto.go index d410950..cf68bb5 100644 --- a/node/stmt/goto.go +++ b/node/stmt/goto.go @@ -7,14 +7,14 @@ import ( type Goto struct { attributes map[string]interface{} position *node.Position - label node.Node + Label node.Node } -func NewGoto(label node.Node) node.Node { +func NewGoto(Label node.Node) node.Node { return &Goto{ map[string]interface{}{}, nil, - label, + Label, } } @@ -36,9 +36,9 @@ func (n Goto) Walk(v node.Visitor) { return } - if n.label != nil { - vv := v.GetChildrenVisitor("label") - n.label.Walk(vv) + if n.Label != nil { + vv := v.GetChildrenVisitor("Label") + n.Label.Walk(vv) } v.LeaveNode(n) diff --git a/node/stmt/group_use.go b/node/stmt/group_use.go index c617295..ab2dc07 100644 --- a/node/stmt/group_use.go +++ b/node/stmt/group_use.go @@ -7,18 +7,18 @@ import ( type GroupUse struct { attributes map[string]interface{} position *node.Position - useType node.Node - prefix node.Node - useList []node.Node + UseType node.Node + pRefix node.Node + UseList []node.Node } -func NewGroupUse(useType node.Node, prefix node.Node, useList []node.Node) node.Node { +func NewGroupUse(UseType node.Node, pRefix node.Node, UseList []node.Node) node.Node { return &GroupUse{ map[string]interface{}{}, nil, - useType, - prefix, - useList, + UseType, + pRefix, + UseList, } } @@ -35,8 +35,8 @@ func (n GroupUse) SetPosition(p *node.Position) node.Node { return n } -func (n GroupUse) SetUseType(useType node.Node) node.Node { - n.useType = useType +func (n GroupUse) SetUseType(UseType node.Node) node.Node { + n.UseType = UseType return n } @@ -45,19 +45,19 @@ func (n GroupUse) Walk(v node.Visitor) { return } - if n.useType != nil { - vv := v.GetChildrenVisitor("useType") - n.useType.Walk(vv) + if n.UseType != nil { + vv := v.GetChildrenVisitor("UseType") + n.UseType.Walk(vv) } - if n.prefix != nil { - vv := v.GetChildrenVisitor("prefix") - n.prefix.Walk(vv) + if n.pRefix != nil { + vv := v.GetChildrenVisitor("pRefix") + n.pRefix.Walk(vv) } - if n.useList != nil { - vv := v.GetChildrenVisitor("useList") - for _, nn := range n.useList { + if n.UseList != nil { + vv := v.GetChildrenVisitor("UseList") + for _, nn := range n.UseList { nn.Walk(vv) } } diff --git a/node/stmt/if.go b/node/stmt/if.go index d1a1388..854cc3a 100644 --- a/node/stmt/if.go +++ b/node/stmt/if.go @@ -7,18 +7,18 @@ import ( type If struct { attributes map[string]interface{} position *node.Position - cond node.Node - stmt node.Node - elseIf []node.Node + Cond node.Node + Stmt node.Node + ElseIf []node.Node _else node.Node } -func NewIf(cond node.Node, stmt node.Node) node.Node { +func NewIf(Cond node.Node, Stmt node.Node) node.Node { return &If{ map[string]interface{}{}, nil, - cond, - stmt, + Cond, + Stmt, nil, nil, } @@ -37,12 +37,12 @@ func (n If) SetPosition(p *node.Position) node.Node { return n } -func (n If) AddElseIf(elseIf node.Node) node.Node { - if n.elseIf == nil { - n.elseIf = make([]node.Node, 0) +func (n If) AddElseIf(ElseIf node.Node) node.Node { + if n.ElseIf == nil { + n.ElseIf = make([]node.Node, 0) } - n.elseIf = append(n.elseIf, elseIf) + n.ElseIf = append(n.ElseIf, ElseIf) return n } @@ -58,19 +58,19 @@ func (n If) Walk(v node.Visitor) { return } - if n.cond != nil { - vv := v.GetChildrenVisitor("cond") - n.cond.Walk(vv) + if n.Cond != nil { + vv := v.GetChildrenVisitor("Cond") + n.Cond.Walk(vv) } - if n.stmt != nil { - vv := v.GetChildrenVisitor("stmt") - n.stmt.Walk(vv) + if n.Stmt != nil { + vv := v.GetChildrenVisitor("Stmt") + n.Stmt.Walk(vv) } - if n.elseIf != nil { - vv := v.GetChildrenVisitor("elseIf") - for _, nn := range n.elseIf { + if n.ElseIf != nil { + vv := v.GetChildrenVisitor("ElseIf") + for _, nn := range n.ElseIf { nn.Walk(vv) } } diff --git a/node/stmt/inline_html.go b/node/stmt/inline_html.go index c23b1d9..468166d 100644 --- a/node/stmt/inline_html.go +++ b/node/stmt/inline_html.go @@ -9,10 +9,10 @@ type InlineHtml struct { position *node.Position } -func NewInlineHtml(value string) node.Node { +func NewInlineHtml(Value string) node.Node { return &InlineHtml{ map[string]interface{}{ - "value": value, + "Value": Value, }, nil, } diff --git a/node/stmt/interface.go b/node/stmt/interface.go index 4badbc6..453940b 100644 --- a/node/stmt/interface.go +++ b/node/stmt/interface.go @@ -7,20 +7,20 @@ import ( type Interface struct { attributes map[string]interface{} position *node.Position - interfaceName node.Node - extends []node.Node - stmts []node.Node + InterfaceName node.Node + Extends []node.Node + Stmts []node.Node } -func NewInterface(interfaceName node.Node, extends []node.Node, stmts []node.Node, phpDocComment string) node.Node { +func NewInterface(InterfaceName node.Node, Extends []node.Node, Stmts []node.Node, phpDocComment string) node.Node { return &Interface{ map[string]interface{}{ "phpDocComment": phpDocComment, }, nil, - interfaceName, - extends, - stmts, + InterfaceName, + Extends, + Stmts, } } @@ -42,21 +42,21 @@ func (n Interface) Walk(v node.Visitor) { return } - if n.interfaceName != nil { - vv := v.GetChildrenVisitor("interfaceName") - n.interfaceName.Walk(vv) + if n.InterfaceName != nil { + vv := v.GetChildrenVisitor("InterfaceName") + n.InterfaceName.Walk(vv) } - if n.extends != nil { - vv := v.GetChildrenVisitor("extends") - for _, nn := range n.extends { + if n.Extends != nil { + vv := v.GetChildrenVisitor("Extends") + for _, nn := range n.Extends { nn.Walk(vv) } } - if n.stmts != nil { - vv := v.GetChildrenVisitor("stmts") - for _, nn := range n.stmts { + if n.Stmts != nil { + vv := v.GetChildrenVisitor("Stmts") + for _, nn := range n.Stmts { nn.Walk(vv) } } diff --git a/node/stmt/label.go b/node/stmt/label.go index cc8f0d3..85ac0b3 100644 --- a/node/stmt/label.go +++ b/node/stmt/label.go @@ -7,14 +7,14 @@ import ( type Label struct { attributes map[string]interface{} position *node.Position - labelName node.Node + LabelName node.Node } -func NewLabel(labelName node.Node) node.Node { +func NewLabel(LabelName node.Node) node.Node { return &Label{ map[string]interface{}{}, nil, - labelName, + LabelName, } } @@ -36,9 +36,9 @@ func (n Label) Walk(v node.Visitor) { return } - if n.labelName != nil { - vv := v.GetChildrenVisitor("labelName") - n.labelName.Walk(vv) + if n.LabelName != nil { + vv := v.GetChildrenVisitor("LabelName") + n.LabelName.Walk(vv) } v.LeaveNode(n) diff --git a/node/stmt/namespace.go b/node/stmt/namespace.go index 5b17310..c5183f0 100644 --- a/node/stmt/namespace.go +++ b/node/stmt/namespace.go @@ -7,16 +7,16 @@ import ( type Namespace struct { attributes map[string]interface{} position *node.Position - namespaceName node.Node - stmts []node.Node + NamespaceName node.Node + Stmts []node.Node } -func NewNamespace(namespaceName node.Node, stmts []node.Node) node.Node { +func NewNamespace(NamespaceName node.Node, Stmts []node.Node) node.Node { return &Namespace{ map[string]interface{}{}, nil, - namespaceName, - stmts, + NamespaceName, + Stmts, } } @@ -38,14 +38,14 @@ func (n Namespace) Walk(v node.Visitor) { return } - if n.namespaceName != nil { - vv := v.GetChildrenVisitor("namespaceName") - n.namespaceName.Walk(vv) + if n.NamespaceName != nil { + vv := v.GetChildrenVisitor("NamespaceName") + n.NamespaceName.Walk(vv) } - if n.stmts != nil { - vv := v.GetChildrenVisitor("stmts") - for _, nn := range n.stmts { + if n.Stmts != nil { + vv := v.GetChildrenVisitor("Stmts") + for _, nn := range n.Stmts { nn.Walk(vv) } } diff --git a/node/stmt/property.go b/node/stmt/property.go index 864fd31..83772ab 100644 --- a/node/stmt/property.go +++ b/node/stmt/property.go @@ -7,17 +7,17 @@ import ( type Property struct { attributes map[string]interface{} position *node.Position - variable node.Node + Variable node.Node expr node.Node } -func NewProperty(variable node.Node, expr node.Node, phpDocComment string) node.Node { +func NewProperty(Variable node.Node, expr node.Node, phpDocComment string) node.Node { return &Property{ map[string]interface{}{ "phpDocComment": phpDocComment, }, nil, - variable, + Variable, expr, } } @@ -39,9 +39,9 @@ func (n Property) Walk(v node.Visitor) { return } - if n.variable != nil { - vv := v.GetChildrenVisitor("variable") - n.variable.Walk(vv) + if n.Variable != nil { + vv := v.GetChildrenVisitor("Variable") + n.Variable.Walk(vv) } if n.expr != nil { diff --git a/node/stmt/property_list.go b/node/stmt/property_list.go index a233558..e290ba1 100644 --- a/node/stmt/property_list.go +++ b/node/stmt/property_list.go @@ -7,16 +7,16 @@ import ( type PropertyList struct { attributes map[string]interface{} position *node.Position - modifiers []node.Node - properties []node.Node + Modifiers []node.Node + Properties []node.Node } -func NewPropertyList(modifiers []node.Node, properties []node.Node) node.Node { +func NewPropertyList(Modifiers []node.Node, Properties []node.Node) node.Node { return &PropertyList{ map[string]interface{}{}, nil, - modifiers, - properties, + Modifiers, + Properties, } } @@ -38,16 +38,16 @@ func (n PropertyList) Walk(v node.Visitor) { return } - if n.modifiers != nil { - vv := v.GetChildrenVisitor("modifiers") - for _, nn := range n.modifiers { + if n.Modifiers != nil { + vv := v.GetChildrenVisitor("Modifiers") + for _, nn := range n.Modifiers { nn.Walk(vv) } } - if n.properties != nil { - vv := v.GetChildrenVisitor("properties") - for _, nn := range n.properties { + if n.Properties != nil { + vv := v.GetChildrenVisitor("Properties") + for _, nn := range n.Properties { nn.Walk(vv) } } diff --git a/node/stmt/static.go b/node/stmt/static.go index 72b756d..cd18982 100644 --- a/node/stmt/static.go +++ b/node/stmt/static.go @@ -7,14 +7,14 @@ import ( type Static struct { attributes map[string]interface{} position *node.Position - vars []node.Node + Vars []node.Node } -func NewStatic(vars []node.Node) node.Node { +func NewStatic(Vars []node.Node) node.Node { return &Static{ map[string]interface{}{}, nil, - vars, + Vars, } } @@ -36,9 +36,9 @@ func (n Static) Walk(v node.Visitor) { return } - if n.vars != nil { - vv := v.GetChildrenVisitor("vars") - for _, nn := range n.vars { + if n.Vars != nil { + vv := v.GetChildrenVisitor("Vars") + for _, nn := range n.Vars { nn.Walk(vv) } } diff --git a/node/stmt/static_var.go b/node/stmt/static_var.go index 9e3a805..06ddf45 100644 --- a/node/stmt/static_var.go +++ b/node/stmt/static_var.go @@ -7,15 +7,15 @@ import ( type StaticVar struct { attributes map[string]interface{} position *node.Position - variable node.Node + Variable node.Node expr node.Node } -func NewStaticVar(variable node.Node, expr node.Node) node.Node { +func NewStaticVar(Variable node.Node, expr node.Node) node.Node { return &StaticVar{ map[string]interface{}{}, nil, - variable, + Variable, expr, } } @@ -38,9 +38,9 @@ func (n StaticVar) Walk(v node.Visitor) { return } - if n.variable != nil { - vv := v.GetChildrenVisitor("variable") - n.variable.Walk(vv) + if n.Variable != nil { + vv := v.GetChildrenVisitor("Variable") + n.Variable.Walk(vv) } if n.expr != nil { diff --git a/node/stmt/stmt_list.go b/node/stmt/stmt_list.go index 54847b4..65e852f 100644 --- a/node/stmt/stmt_list.go +++ b/node/stmt/stmt_list.go @@ -7,14 +7,14 @@ import ( type StmtList struct { attributes map[string]interface{} position *node.Position - stmts []node.Node + Stmts []node.Node } -func NewStmtList(stmts []node.Node) node.Node { - return &StmtList{ +func NewStmtList(Stmts []node.Node) node.Node { + return StmtList{ map[string]interface{}{}, nil, - stmts, + Stmts, } } @@ -36,9 +36,9 @@ func (n StmtList) Walk(v node.Visitor) { return } - if n.stmts != nil { - vv := v.GetChildrenVisitor("stmts") - for _, nn := range n.stmts { + if n.Stmts != nil { + vv := v.GetChildrenVisitor("Stmts") + for _, nn := range n.Stmts { nn.Walk(vv) } } diff --git a/node/stmt/switch.go b/node/stmt/switch.go index 611226e..f65e133 100644 --- a/node/stmt/switch.go +++ b/node/stmt/switch.go @@ -9,16 +9,16 @@ type Switch struct { attributes map[string]interface{} position *node.Position token token.Token - cond node.Node + Cond node.Node cases []node.Node } -func NewSwitch(token token.Token, cond node.Node, cases []node.Node) node.Node { +func NewSwitch(token token.Token, Cond node.Node, cases []node.Node) node.Node { return &Switch{ map[string]interface{}{}, nil, token, - cond, + Cond, cases, } } @@ -41,9 +41,9 @@ func (n Switch) Walk(v node.Visitor) { return } - if n.cond != nil { - vv := v.GetChildrenVisitor("cond") - n.cond.Walk(vv) + if n.Cond != nil { + vv := v.GetChildrenVisitor("Cond") + n.Cond.Walk(vv) } if n.cases != nil { diff --git a/node/stmt/trait.go b/node/stmt/trait.go index e6b5209..5711c34 100644 --- a/node/stmt/trait.go +++ b/node/stmt/trait.go @@ -7,18 +7,18 @@ import ( type Trait struct { attributes map[string]interface{} position *node.Position - traitName node.Node - stmts []node.Node + TraitName node.Node + Stmts []node.Node } -func NewTrait(traitName node.Node, stmts []node.Node, phpDocComment string) node.Node { +func NewTrait(TraitName node.Node, Stmts []node.Node, phpDocComment string) node.Node { return &Trait{ map[string]interface{}{ "phpDocComment": phpDocComment, }, nil, - traitName, - stmts, + TraitName, + Stmts, } } @@ -40,14 +40,14 @@ func (n Trait) Walk(v node.Visitor) { return } - if n.traitName != nil { - vv := v.GetChildrenVisitor("traitName") - n.traitName.Walk(vv) + if n.TraitName != nil { + vv := v.GetChildrenVisitor("TraitName") + n.TraitName.Walk(vv) } - if n.stmts != nil { - vv := v.GetChildrenVisitor("stmts") - for _, nn := range n.stmts { + if n.Stmts != nil { + vv := v.GetChildrenVisitor("Stmts") + for _, nn := range n.Stmts { nn.Walk(vv) } } diff --git a/node/stmt/trait_method_ref.go b/node/stmt/trait_method_ref.go index 5750426..48760e0 100644 --- a/node/stmt/trait_method_ref.go +++ b/node/stmt/trait_method_ref.go @@ -7,16 +7,16 @@ import ( type TraitMethodRef struct { attributes map[string]interface{} position *node.Position - trait node.Node - method node.Node + Trait node.Node + Method node.Node } -func NewTraitMethodRef(trait node.Node, method node.Node) node.Node { +func NewTraitMethodRef(Trait node.Node, Method node.Node) node.Node { return &TraitMethodRef{ map[string]interface{}{}, nil, - trait, - method, + Trait, + Method, } } @@ -38,14 +38,14 @@ func (n TraitMethodRef) Walk(v node.Visitor) { return } - if n.trait != nil { - vv := v.GetChildrenVisitor("trait") - n.trait.Walk(vv) + if n.Trait != nil { + vv := v.GetChildrenVisitor("Trait") + n.Trait.Walk(vv) } - if n.method != nil { - vv := v.GetChildrenVisitor("method") - n.method.Walk(vv) + if n.Method != nil { + vv := v.GetChildrenVisitor("Method") + n.Method.Walk(vv) } v.LeaveNode(n) diff --git a/node/stmt/trait_use.go b/node/stmt/trait_use.go index 94001d3..91154eb 100644 --- a/node/stmt/trait_use.go +++ b/node/stmt/trait_use.go @@ -7,16 +7,16 @@ import ( type TraitUse struct { attributes map[string]interface{} position *node.Position - traits []node.Node - adaptations []node.Node + Traits []node.Node + Adaptations []node.Node } -func NewTraitUse(traits []node.Node, adaptations []node.Node) node.Node { +func NewTraitUse(Traits []node.Node, Adaptations []node.Node) node.Node { return &TraitUse{ map[string]interface{}{}, nil, - traits, - adaptations, + Traits, + Adaptations, } } @@ -38,16 +38,16 @@ func (n TraitUse) Walk(v node.Visitor) { return } - if n.traits != nil { - vv := v.GetChildrenVisitor("traits") - for _, nn := range n.traits { + if n.Traits != nil { + vv := v.GetChildrenVisitor("Traits") + for _, nn := range n.Traits { nn.Walk(vv) } } - if n.adaptations != nil { - vv := v.GetChildrenVisitor("adaptations") - for _, nn := range n.adaptations { + if n.Adaptations != nil { + vv := v.GetChildrenVisitor("Adaptations") + for _, nn := range n.Adaptations { nn.Walk(vv) } } diff --git a/node/stmt/trait_use_alias.go b/node/stmt/trait_use_alias.go index 3a29b7a..a583d4c 100644 --- a/node/stmt/trait_use_alias.go +++ b/node/stmt/trait_use_alias.go @@ -7,18 +7,18 @@ import ( type TraitUseAlias struct { attributes map[string]interface{} position *node.Position - ref node.Node - modifier node.Node - alias node.Node + Ref node.Node + Modifier node.Node + Alias node.Node } -func NewTraitUseAlias(ref node.Node, modifier node.Node, alias node.Node) node.Node { +func NewTraitUseAlias(Ref node.Node, Modifier node.Node, Alias node.Node) node.Node { return &TraitUseAlias{ map[string]interface{}{}, nil, - ref, - modifier, - alias, + Ref, + Modifier, + Alias, } } @@ -40,19 +40,19 @@ func (n TraitUseAlias) Walk(v node.Visitor) { return } - if n.ref != nil { - vv := v.GetChildrenVisitor("ref") - n.ref.Walk(vv) + if n.Ref != nil { + vv := v.GetChildrenVisitor("Ref") + n.Ref.Walk(vv) } - if n.modifier != nil { - vv := v.GetChildrenVisitor("modifier") - n.modifier.Walk(vv) + if n.Modifier != nil { + vv := v.GetChildrenVisitor("Modifier") + n.Modifier.Walk(vv) } - if n.alias != nil { - vv := v.GetChildrenVisitor("alias") - n.alias.Walk(vv) + if n.Alias != nil { + vv := v.GetChildrenVisitor("Alias") + n.Alias.Walk(vv) } v.LeaveNode(n) diff --git a/node/stmt/trait_use_precedence.go b/node/stmt/trait_use_precedence.go index f858efa..4186880 100644 --- a/node/stmt/trait_use_precedence.go +++ b/node/stmt/trait_use_precedence.go @@ -7,16 +7,16 @@ import ( type TraitUsePrecedence struct { attributes map[string]interface{} position *node.Position - ref node.Node - insteadof node.Node + Ref node.Node + Insteadof node.Node } -func NewTraitUsePrecedence(ref node.Node, insteadof node.Node) node.Node { +func NewTraitUsePrecedence(Ref node.Node, Insteadof node.Node) node.Node { return &TraitUsePrecedence{ map[string]interface{}{}, nil, - ref, - insteadof, + Ref, + Insteadof, } } @@ -38,14 +38,14 @@ func (n TraitUsePrecedence) Walk(v node.Visitor) { return } - if n.ref != nil { - vv := v.GetChildrenVisitor("ref") - n.ref.Walk(vv) + if n.Ref != nil { + vv := v.GetChildrenVisitor("Ref") + n.Ref.Walk(vv) } - if n.insteadof != nil { - vv := v.GetChildrenVisitor("insteadof") - n.insteadof.Walk(vv) + if n.Insteadof != nil { + vv := v.GetChildrenVisitor("Insteadof") + n.Insteadof.Walk(vv) } v.LeaveNode(n) diff --git a/node/stmt/try.go b/node/stmt/try.go index e67ac75..90d0169 100644 --- a/node/stmt/try.go +++ b/node/stmt/try.go @@ -7,18 +7,18 @@ import ( type Try struct { attributes map[string]interface{} position *node.Position - stmts []node.Node - catches []node.Node - finally node.Node + Stmts []node.Node + Catches []node.Node + Finally node.Node } -func NewTry(stmts []node.Node, catches []node.Node, finally node.Node) node.Node { +func NewTry(Stmts []node.Node, Catches []node.Node, Finally node.Node) node.Node { return &Try{ map[string]interface{}{}, nil, - stmts, - catches, - finally, + Stmts, + Catches, + Finally, } } @@ -40,23 +40,23 @@ func (n Try) Walk(v node.Visitor) { return } - if n.stmts != nil { - vv := v.GetChildrenVisitor("stmts") - for _, nn := range n.stmts { + if n.Stmts != nil { + vv := v.GetChildrenVisitor("Stmts") + for _, nn := range n.Stmts { nn.Walk(vv) } } - if n.catches != nil { - vv := v.GetChildrenVisitor("catches") - for _, nn := range n.catches { + if n.Catches != nil { + vv := v.GetChildrenVisitor("Catches") + for _, nn := range n.Catches { nn.Walk(vv) } } - if n.finally != nil { - vv := v.GetChildrenVisitor("finally") - n.finally.Walk(vv) + if n.Finally != nil { + vv := v.GetChildrenVisitor("Finally") + n.Finally.Walk(vv) } v.LeaveNode(n) diff --git a/node/stmt/unset.go b/node/stmt/unset.go index 2a13506..77edbed 100644 --- a/node/stmt/unset.go +++ b/node/stmt/unset.go @@ -7,14 +7,14 @@ import ( type Unset struct { attributes map[string]interface{} position *node.Position - vars []node.Node + Vars []node.Node } -func NewUnset(vars []node.Node) node.Node { +func NewUnset(Vars []node.Node) node.Node { return &Unset{ map[string]interface{}{}, nil, - vars, + Vars, } } @@ -36,9 +36,9 @@ func (n Unset) Walk(v node.Visitor) { return } - if n.vars != nil { - vv := v.GetChildrenVisitor("vars") - for _, nn := range n.vars { + if n.Vars != nil { + vv := v.GetChildrenVisitor("Vars") + for _, nn := range n.Vars { nn.Walk(vv) } } diff --git a/node/stmt/use.go b/node/stmt/use.go index e2668e2..8da0431 100644 --- a/node/stmt/use.go +++ b/node/stmt/use.go @@ -5,25 +5,23 @@ import ( ) type Use struct { - attributes map[string]interface{} - position *node.Position - useType node.Node - use node.Node - alias node.Node + position *node.Position + UseType node.Node + Use node.Node + Alias node.Node } -func NewUse(useType node.Node, use node.Node, alias node.Node) node.Node { +func NewUse(UseType node.Node, use node.Node, Alias node.Node) node.Node { return &Use{ - map[string]interface{}{}, nil, - useType, + UseType, use, - alias, + Alias, } } func (n Use) Attributes() map[string]interface{} { - return n.attributes + return nil } func (n Use) Position() *node.Position { @@ -35,8 +33,8 @@ func (n Use) SetPosition(p *node.Position) node.Node { return n } -func (n Use) SetUseType(useType node.Node) node.Node { - n.useType = useType +func (n Use) SetUseType(UseType node.Node) node.Node { + n.UseType = UseType return n } @@ -45,19 +43,19 @@ func (n Use) Walk(v node.Visitor) { return } - if n.useType != nil { - vv := v.GetChildrenVisitor("useType") - n.useType.Walk(vv) + if n.UseType != nil { + vv := v.GetChildrenVisitor("UseType") + n.UseType.Walk(vv) } - if n.use != nil { - vv := v.GetChildrenVisitor("use") - n.use.Walk(vv) + if n.Use != nil { + vv := v.GetChildrenVisitor("Use") + n.Use.Walk(vv) } - if n.alias != nil { - vv := v.GetChildrenVisitor("alias") - n.alias.Walk(vv) + if n.Alias != nil { + vv := v.GetChildrenVisitor("Alias") + n.Alias.Walk(vv) } v.LeaveNode(n) diff --git a/node/stmt/use_list.go b/node/stmt/use_list.go index f1f4ad4..b17fbc3 100644 --- a/node/stmt/use_list.go +++ b/node/stmt/use_list.go @@ -5,23 +5,21 @@ import ( ) type UseList struct { - attributes map[string]interface{} - position *node.Position - useType node.Node - uses []node.Node + position *node.Position + UseType node.Node + Uses []node.Node } -func NewUseList(useType node.Node, uses []node.Node) node.Node { +func NewUseList(UseType node.Node, Uses []node.Node) node.Node { return &UseList{ - map[string]interface{}{}, nil, - useType, - uses, + UseType, + Uses, } } func (n UseList) Attributes() map[string]interface{} { - return n.attributes + return nil } func (n UseList) Position() *node.Position { @@ -38,14 +36,14 @@ func (n UseList) Walk(v node.Visitor) { return } - if n.useType != nil { - vv := v.GetChildrenVisitor("useType") - n.useType.Walk(vv) + if n.UseType != nil { + vv := v.GetChildrenVisitor("UseType") + n.UseType.Walk(vv) } - if n.uses != nil { - vv := v.GetChildrenVisitor("uses") - for _, nn := range n.uses { + if n.Uses != nil { + vv := v.GetChildrenVisitor("Uses") + for _, nn := range n.Uses { nn.Walk(vv) } } diff --git a/node/stmt/while.go b/node/stmt/while.go index 9b726df..081d8b9 100644 --- a/node/stmt/while.go +++ b/node/stmt/while.go @@ -6,25 +6,23 @@ import ( ) type While struct { - attributes map[string]interface{} - position *node.Position - token token.Token - cond node.Node - stmt node.Node + position *node.Position + Token token.Token + Cond node.Node + Stmt node.Node } -func NewWhile(token token.Token, cond node.Node, stmt node.Node) node.Node { +func NewWhile(Token token.Token, Cond node.Node, Stmt node.Node) node.Node { return &While{ - map[string]interface{}{}, nil, - token, - cond, - stmt, + Token, + Cond, + Stmt, } } func (n While) Attributes() map[string]interface{} { - return n.attributes + return nil } func (n While) Position() *node.Position { @@ -41,14 +39,14 @@ func (n While) Walk(v node.Visitor) { return } - if n.cond != nil { - vv := v.GetChildrenVisitor("cond") - n.cond.Walk(vv) + if n.Cond != nil { + vv := v.GetChildrenVisitor("Cond") + n.Cond.Walk(vv) } - if n.stmt != nil { - vv := v.GetChildrenVisitor("stmt") - n.stmt.Walk(vv) + if n.Stmt != nil { + vv := v.GetChildrenVisitor("Stmt") + n.Stmt.Walk(vv) } v.LeaveNode(n) diff --git a/node/visitor.go b/node/visitor.go index 43195ad..b92ee95 100644 --- a/node/visitor.go +++ b/node/visitor.go @@ -2,6 +2,6 @@ package node type Visitor interface { EnterNode(node Node) bool - GetChildrenVisitor(key string) Visitor + GetChildrenVisitor(Key string) Visitor LeaveNode(node Node) }