From cdb405fcc7c22ad05f99504282dbfc779efd7c46 Mon Sep 17 00:00:00 2001 From: vadim Date: Fri, 29 Dec 2017 17:53:13 +0200 Subject: [PATCH] add attributes fiald to all nodes --- dumper.go | 2 +- node/expr/array.go | 8 +++++--- node/expr/array_dim_fetch.go | 10 ++++++---- node/expr/array_item.go | 2 +- node/expr/assign_op/assign.go | 3 ++- node/expr/assign_op/assign_op.go | 1 + node/expr/assign_op/assign_ref.go | 3 ++- node/expr/assign_op/bitwise_and.go | 3 ++- node/expr/assign_op/bitwise_or.go | 3 ++- node/expr/assign_op/bitwise_xor.go | 3 ++- node/expr/assign_op/concat.go | 3 ++- node/expr/assign_op/div.go | 3 ++- node/expr/assign_op/minus.go | 3 ++- node/expr/assign_op/mod.go | 3 ++- node/expr/assign_op/mul.go | 3 ++- node/expr/assign_op/plus.go | 3 ++- node/expr/assign_op/pow.go | 3 ++- node/expr/assign_op/shift_left.go | 3 ++- node/expr/assign_op/shift_right.go | 3 ++- node/expr/binary_op/binary_op.go | 7 ++++--- node/expr/binary_op/bitwise_and.go | 3 ++- node/expr/binary_op/bitwise_or.go | 3 ++- node/expr/binary_op/bitwise_xor.go | 3 ++- node/expr/binary_op/boolean_and.go | 3 ++- node/expr/binary_op/boolean_or.go | 3 ++- node/expr/binary_op/coalesce.go | 3 ++- node/expr/binary_op/concat.go | 3 ++- node/expr/binary_op/div.go | 3 ++- node/expr/binary_op/equal.go | 3 ++- node/expr/binary_op/greater.go | 3 ++- node/expr/binary_op/greater_or_equal.go | 3 ++- node/expr/binary_op/identical.go | 3 ++- node/expr/binary_op/logical_and.go | 3 ++- node/expr/binary_op/logical_or.go | 3 ++- node/expr/binary_op/logical_xor.go | 3 ++- node/expr/binary_op/minus.go | 3 ++- node/expr/binary_op/mod.go | 3 ++- node/expr/binary_op/mul.go | 3 ++- node/expr/binary_op/not_equal.go | 3 ++- node/expr/binary_op/not_identical.go | 3 ++- node/expr/binary_op/plus.go | 3 ++- node/expr/binary_op/pow.go | 3 ++- node/expr/binary_op/shift_left.go | 3 ++- node/expr/binary_op/shift_right.go | 3 ++- node/expr/binary_op/smaller.go | 3 ++- node/expr/binary_op/smaller_or_equal.go | 3 ++- node/expr/binary_op/spaceship.go | 3 ++- node/expr/bitwise_not.go | 8 +++++--- node/expr/boolean_not.go | 8 +++++--- node/expr/cast/cast.go | 5 +++-- node/expr/cast/cast_array.go | 3 ++- node/expr/cast/cast_bool.go | 3 ++- node/expr/cast/cast_double.go | 3 ++- node/expr/cast/cast_int.go | 3 ++- node/expr/cast/cast_object.go | 3 ++- node/expr/cast/cast_string.go | 3 ++- node/expr/cast/cast_unset.go | 3 ++- node/expr/class_const_fetch.go | 4 +++- node/expr/clone.go | 8 +++++--- node/expr/closure.go | 2 +- node/expr/closure_use.go | 2 +- node/expr/const_fetch.go | 8 +++++--- node/expr/empty.go | 8 +++++--- node/expr/error_suppress.go | 8 +++++--- node/expr/eval.go | 8 +++++--- node/expr/exit.go | 2 +- node/expr/function_call.go | 10 ++++++---- node/expr/include.go | 8 +++++--- node/expr/include_once.go | 8 +++++--- node/expr/instance_of.go | 10 ++++++---- node/expr/isset.go | 8 +++++--- node/expr/list.go | 8 +++++--- node/expr/method_call.go | 12 +++++++----- node/expr/new.go | 10 ++++++---- node/expr/post_dec.go | 8 +++++--- node/expr/post_inc.go | 8 +++++--- node/expr/pre_dec.go | 8 +++++--- node/expr/pre_inc.go | 8 +++++--- node/expr/print.go | 8 +++++--- node/expr/property_fetch.go | 10 ++++++---- node/expr/require.go | 8 +++++--- node/expr/require_once.go | 8 +++++--- node/expr/shell_exec.go | 8 +++++--- node/expr/short_array.go | 8 +++++--- node/expr/short_list.go | 8 +++++--- node/expr/static_call.go | 12 +++++++----- node/expr/static_property_fetch.go | 10 ++++++---- node/expr/ternary.go | 12 +++++++----- node/expr/unary_minus.go | 8 +++++--- node/expr/unary_plus.go | 8 +++++--- node/expr/variable.go | 8 +++++--- node/expr/yield.go | 10 ++++++---- node/expr/yield_from.go | 8 +++++--- node/name/fully_qualified.go | 3 ++- node/name/name.go | 8 +++++--- node/name/relative.go | 3 ++- node/nullable.go | 8 +++++--- node/scalar/dnumber.go | 2 +- node/scalar/encapsed.go | 8 +++++--- node/scalar/encapsed_string_part.go | 2 +- node/scalar/lnumber.go | 2 +- node/scalar/magic_constant.go | 2 +- node/scalar/string.go | 2 +- node/stmt/alt_else.go | 8 +++++--- node/stmt/alt_else_if.go | 10 ++++++---- node/stmt/alt_if.go | 14 ++++++++------ node/stmt/break.go | 8 +++++--- node/stmt/case.go | 10 ++++++---- node/stmt/catch.go | 12 +++++++----- node/stmt/class.go | 4 +++- node/stmt/class_const_list.go | 10 ++++++---- node/stmt/class_method.go | 2 +- node/stmt/const_list.go | 8 +++++--- node/stmt/constant.go | 4 +++- node/stmt/continue.go | 8 +++++--- node/stmt/declare.go | 10 ++++++---- node/stmt/default.go | 8 +++++--- node/stmt/do.go | 10 ++++++---- node/stmt/echo.go | 8 +++++--- node/stmt/else.go | 8 +++++--- node/stmt/else_if.go | 10 ++++++---- node/stmt/expression.go | 8 +++++--- node/stmt/finally.go | 8 +++++--- node/stmt/for.go | 14 ++++++++------ node/stmt/global.go | 8 +++++--- node/stmt/goto.go | 8 +++++--- node/stmt/group_use.go | 12 +++++++----- node/stmt/halt_compiler.go | 6 ++++-- node/stmt/if.go | 14 ++++++++------ node/stmt/interface.go | 4 +++- node/stmt/label.go | 8 +++++--- node/stmt/namespace.go | 4 +++- node/stmt/nop.go | 6 ++++-- node/stmt/property.go | 10 ++++++---- node/stmt/property_list.go | 4 +++- node/stmt/return.go | 8 +++++--- node/stmt/static.go | 8 +++++--- node/stmt/static_var.go | 10 ++++++---- node/stmt/stmt_list.go | 8 +++++--- node/stmt/switch.go | 12 +++++++----- node/stmt/throw.go | 8 +++++--- node/stmt/trait.go | 10 ++++++---- node/stmt/trait_method_ref.go | 10 ++++++---- node/stmt/trait_use.go | 4 +++- node/stmt/trait_use_alias.go | 12 +++++++----- node/stmt/trait_use_precedence.go | 10 ++++++---- node/stmt/try.go | 12 +++++++----- node/stmt/unset.go | 8 +++++--- node/stmt/use.go | 12 +++++++----- node/stmt/use_list.go | 10 ++++++---- node/stmt/while.go | 12 +++++++----- 151 files changed, 586 insertions(+), 359 deletions(-) diff --git a/dumper.go b/dumper.go index d3b16c3..e4beb56 100644 --- a/dumper.go +++ b/dumper.go @@ -13,7 +13,7 @@ type dumper struct { func (d dumper) EnterNode(n node.Node) bool { fmt.Printf("%v%v", d.indent, n.Name()) - if a := n.Attributes(); a != nil { + if a := n.Attributes(); len(a) > 0 { fmt.Printf(" %v", a) } fmt.Println() diff --git a/node/expr/array.go b/node/expr/array.go index 1a720c7..1c5f07e 100644 --- a/node/expr/array.go +++ b/node/expr/array.go @@ -5,13 +5,15 @@ import ( ) type Array struct { - name string - items []node.Node + name string + attributes map[string]interface{} + items []node.Node } func NewArray(items []node.Node) node.Node { return Array{ "Array", + map[string]interface{}{}, items, } } @@ -21,7 +23,7 @@ func (n Array) Name() string { } func (n Array) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Array) Walk(v node.Visitor) { diff --git a/node/expr/array_dim_fetch.go b/node/expr/array_dim_fetch.go index a8a5437..e0a4da4 100644 --- a/node/expr/array_dim_fetch.go +++ b/node/expr/array_dim_fetch.go @@ -5,14 +5,16 @@ import ( ) type ArrayDimFetch struct { - name string - variable node.Node - dim node.Node + name string + attributes map[string]interface{} + variable node.Node + dim node.Node } func NewArrayDimFetch(variable node.Node, dim node.Node) node.Node { return ArrayDimFetch{ "ArrayDimFetch", + map[string]interface{}{}, variable, dim, } @@ -23,7 +25,7 @@ func (n ArrayDimFetch) Name() string { } func (n ArrayDimFetch) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n ArrayDimFetch) Walk(v node.Visitor) { diff --git a/node/expr/array_item.go b/node/expr/array_item.go index a7b841b..cfdb92c 100644 --- a/node/expr/array_item.go +++ b/node/expr/array_item.go @@ -27,7 +27,7 @@ func (n ArrayItem) Name() string { } func (n ArrayItem) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n ArrayItem) Walk(v node.Visitor) { diff --git a/node/expr/assign_op/assign.go b/node/expr/assign_op/assign.go index 48f106b..d6f121f 100644 --- a/node/expr/assign_op/assign.go +++ b/node/expr/assign_op/assign.go @@ -12,6 +12,7 @@ func NewAssign(variable node.Node, expression node.Node) node.Node { return Assign{ AssignOp{ "Assign", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n Assign) Name() string { } func (n Assign) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Assign) Walk(v node.Visitor) { diff --git a/node/expr/assign_op/assign_op.go b/node/expr/assign_op/assign_op.go index a0da3f7..c71cbb7 100644 --- a/node/expr/assign_op/assign_op.go +++ b/node/expr/assign_op/assign_op.go @@ -6,6 +6,7 @@ import ( type AssignOp struct { name string + attributes map[string]interface{} 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 27a2e23..4dbd952 100644 --- a/node/expr/assign_op/assign_ref.go +++ b/node/expr/assign_op/assign_ref.go @@ -12,6 +12,7 @@ func NewAssignRef(variable node.Node, expression node.Node) node.Node { return AssignRef{ AssignOp{ "AssignRef", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n AssignRef) Name() string { } func (n AssignRef) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n AssignRef) Walk(v node.Visitor) { diff --git a/node/expr/assign_op/bitwise_and.go b/node/expr/assign_op/bitwise_and.go index 183248c..8f99304 100644 --- a/node/expr/assign_op/bitwise_and.go +++ b/node/expr/assign_op/bitwise_and.go @@ -12,6 +12,7 @@ func NewBitwiseAnd(variable node.Node, expression node.Node) node.Node { return BitwiseAnd{ AssignOp{ "AssignBitwiseAnd", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n BitwiseAnd) Name() string { } func (n BitwiseAnd) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n BitwiseAnd) Walk(v node.Visitor) { diff --git a/node/expr/assign_op/bitwise_or.go b/node/expr/assign_op/bitwise_or.go index f9c4bed..a609b00 100644 --- a/node/expr/assign_op/bitwise_or.go +++ b/node/expr/assign_op/bitwise_or.go @@ -12,6 +12,7 @@ func NewBitwiseOr(variable node.Node, expression node.Node) node.Node { return BitwiseOr{ AssignOp{ "AssignBitwiseOr", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n BitwiseOr) Name() string { } func (n BitwiseOr) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n BitwiseOr) Walk(v node.Visitor) { diff --git a/node/expr/assign_op/bitwise_xor.go b/node/expr/assign_op/bitwise_xor.go index 0661c30..0490510 100644 --- a/node/expr/assign_op/bitwise_xor.go +++ b/node/expr/assign_op/bitwise_xor.go @@ -12,6 +12,7 @@ func NewBitwiseXor(variable node.Node, expression node.Node) node.Node { return BitwiseXor{ AssignOp{ "AssignBitwiseXor", + map[string]interface{}{}, variable, expression, }, @@ -19,7 +20,7 @@ func NewBitwiseXor(variable node.Node, expression node.Node) node.Node { } func (n BitwiseXor) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n BitwiseXor) Name() string { diff --git a/node/expr/assign_op/concat.go b/node/expr/assign_op/concat.go index 0a91af7..9df20e2 100644 --- a/node/expr/assign_op/concat.go +++ b/node/expr/assign_op/concat.go @@ -12,6 +12,7 @@ func NewConcat(variable node.Node, expression node.Node) node.Node { return Concat{ AssignOp{ "AssignConcat", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n Concat) Name() string { } func (n Concat) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Concat) Walk(v node.Visitor) { diff --git a/node/expr/assign_op/div.go b/node/expr/assign_op/div.go index 8ae9ae5..21a9a3d 100644 --- a/node/expr/assign_op/div.go +++ b/node/expr/assign_op/div.go @@ -12,6 +12,7 @@ func NewDiv(variable node.Node, expression node.Node) node.Node { return Div{ AssignOp{ "AssignDiv", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n Div) Name() string { } func (n Div) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Div) Walk(v node.Visitor) { diff --git a/node/expr/assign_op/minus.go b/node/expr/assign_op/minus.go index 782e5e7..41624d4 100644 --- a/node/expr/assign_op/minus.go +++ b/node/expr/assign_op/minus.go @@ -12,6 +12,7 @@ func NewMinus(variable node.Node, expression node.Node) node.Node { return Minus{ AssignOp{ "AssignMinus", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n Minus) Name() string { } func (n Minus) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Minus) Walk(v node.Visitor) { diff --git a/node/expr/assign_op/mod.go b/node/expr/assign_op/mod.go index 334815d..f107fe9 100644 --- a/node/expr/assign_op/mod.go +++ b/node/expr/assign_op/mod.go @@ -12,6 +12,7 @@ func NewMod(variable node.Node, expression node.Node) node.Node { return Mod{ AssignOp{ "AssignMod", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n Mod) Name() string { } func (n Mod) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Mod) Walk(v node.Visitor) { diff --git a/node/expr/assign_op/mul.go b/node/expr/assign_op/mul.go index 6326165..34ae8e7 100644 --- a/node/expr/assign_op/mul.go +++ b/node/expr/assign_op/mul.go @@ -12,6 +12,7 @@ func NewMul(variable node.Node, expression node.Node) node.Node { return Mul{ AssignOp{ "AssignMul", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n Mul) Name() string { } func (n Mul) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Mul) Walk(v node.Visitor) { diff --git a/node/expr/assign_op/plus.go b/node/expr/assign_op/plus.go index 2a764e6..31942d4 100644 --- a/node/expr/assign_op/plus.go +++ b/node/expr/assign_op/plus.go @@ -12,6 +12,7 @@ func NewPlus(variable node.Node, expression node.Node) node.Node { return Plus{ AssignOp{ "AssignPlus", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n Plus) Name() string { } func (n Plus) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Plus) Walk(v node.Visitor) { diff --git a/node/expr/assign_op/pow.go b/node/expr/assign_op/pow.go index 4807ced..950cc97 100644 --- a/node/expr/assign_op/pow.go +++ b/node/expr/assign_op/pow.go @@ -12,6 +12,7 @@ func NewPow(variable node.Node, expression node.Node) node.Node { return Pow{ AssignOp{ "AssignPow", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n Pow) Name() string { } func (n Pow) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Pow) Walk(v node.Visitor) { diff --git a/node/expr/assign_op/shift_left.go b/node/expr/assign_op/shift_left.go index b913bae..a3888a7 100644 --- a/node/expr/assign_op/shift_left.go +++ b/node/expr/assign_op/shift_left.go @@ -12,6 +12,7 @@ func NewShiftLeft(variable node.Node, expression node.Node) node.Node { return ShiftLeft{ AssignOp{ "AssignShiftLeft", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n ShiftLeft) Name() string { } func (n ShiftLeft) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n ShiftLeft) Walk(v node.Visitor) { diff --git a/node/expr/assign_op/shift_right.go b/node/expr/assign_op/shift_right.go index 4707551..d3f9094 100644 --- a/node/expr/assign_op/shift_right.go +++ b/node/expr/assign_op/shift_right.go @@ -12,6 +12,7 @@ func NewShiftRight(variable node.Node, expression node.Node) node.Node { return ShiftRight{ AssignOp{ "AssignShiftRight", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n ShiftRight) Name() string { } func (n ShiftRight) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n ShiftRight) Walk(v node.Visitor) { diff --git a/node/expr/binary_op/binary_op.go b/node/expr/binary_op/binary_op.go index 167c819..11075ca 100644 --- a/node/expr/binary_op/binary_op.go +++ b/node/expr/binary_op/binary_op.go @@ -5,7 +5,8 @@ import ( ) type BinaryOp struct { - name string - left node.Node - right node.Node + name string + attributes map[string]interface{} + 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 0871304..8d05d6e 100644 --- a/node/expr/binary_op/bitwise_and.go +++ b/node/expr/binary_op/bitwise_and.go @@ -12,6 +12,7 @@ func NewBitwiseAnd(variable node.Node, expression node.Node) node.Node { return BitwiseAnd{ BinaryOp{ "BinaryBitwiseAnd", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n BitwiseAnd) Name() string { } func (n BitwiseAnd) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n BitwiseAnd) Walk(v node.Visitor) { diff --git a/node/expr/binary_op/bitwise_or.go b/node/expr/binary_op/bitwise_or.go index 083242d..1e90370 100644 --- a/node/expr/binary_op/bitwise_or.go +++ b/node/expr/binary_op/bitwise_or.go @@ -12,6 +12,7 @@ func NewBitwiseOr(variable node.Node, expression node.Node) node.Node { return BitwiseOr{ BinaryOp{ "BinaryBitwiseOr", + map[string]interface{}{}, variable, expression, }, @@ -19,7 +20,7 @@ func NewBitwiseOr(variable node.Node, expression node.Node) node.Node { } func (n BitwiseOr) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n BitwiseOr) Name() string { diff --git a/node/expr/binary_op/bitwise_xor.go b/node/expr/binary_op/bitwise_xor.go index a461dd3..0d80770 100644 --- a/node/expr/binary_op/bitwise_xor.go +++ b/node/expr/binary_op/bitwise_xor.go @@ -12,6 +12,7 @@ func NewBitwiseXor(variable node.Node, expression node.Node) node.Node { return BitwiseXor{ BinaryOp{ "BinaryBitwiseXor", + map[string]interface{}{}, variable, expression, }, @@ -19,7 +20,7 @@ func NewBitwiseXor(variable node.Node, expression node.Node) node.Node { } func (n BitwiseXor) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n BitwiseXor) Name() string { diff --git a/node/expr/binary_op/boolean_and.go b/node/expr/binary_op/boolean_and.go index 153d4f8..9755724 100644 --- a/node/expr/binary_op/boolean_and.go +++ b/node/expr/binary_op/boolean_and.go @@ -12,6 +12,7 @@ func NewBooleanAnd(variable node.Node, expression node.Node) node.Node { return BooleanAnd{ BinaryOp{ "BinaryBooleanAnd", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n BooleanAnd) Name() string { } func (n BooleanAnd) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n BooleanAnd) Walk(v node.Visitor) { diff --git a/node/expr/binary_op/boolean_or.go b/node/expr/binary_op/boolean_or.go index 9dfed38..77a97cd 100644 --- a/node/expr/binary_op/boolean_or.go +++ b/node/expr/binary_op/boolean_or.go @@ -12,6 +12,7 @@ func NewBooleanOr(variable node.Node, expression node.Node) node.Node { return BooleanOr{ BinaryOp{ "BinaryBooleanOr", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n BooleanOr) Name() string { } func (n BooleanOr) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n BooleanOr) Walk(v node.Visitor) { diff --git a/node/expr/binary_op/coalesce.go b/node/expr/binary_op/coalesce.go index 81fc772..71009d2 100644 --- a/node/expr/binary_op/coalesce.go +++ b/node/expr/binary_op/coalesce.go @@ -12,6 +12,7 @@ func NewCoalesce(variable node.Node, expression node.Node) node.Node { return Coalesce{ BinaryOp{ "BinaryCoalesce", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n Coalesce) Name() string { } func (n Coalesce) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Coalesce) Walk(v node.Visitor) { diff --git a/node/expr/binary_op/concat.go b/node/expr/binary_op/concat.go index f21001b..147122a 100644 --- a/node/expr/binary_op/concat.go +++ b/node/expr/binary_op/concat.go @@ -12,6 +12,7 @@ func NewConcat(variable node.Node, expression node.Node) node.Node { return Concat{ BinaryOp{ "BinaryConcat", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n Concat) Name() string { } func (n Concat) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Concat) Walk(v node.Visitor) { diff --git a/node/expr/binary_op/div.go b/node/expr/binary_op/div.go index 63e292f..cd56239 100644 --- a/node/expr/binary_op/div.go +++ b/node/expr/binary_op/div.go @@ -12,6 +12,7 @@ func NewDiv(variable node.Node, expression node.Node) node.Node { return Div{ BinaryOp{ "BinaryDiv", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n Div) Name() string { } func (n Div) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Div) Walk(v node.Visitor) { diff --git a/node/expr/binary_op/equal.go b/node/expr/binary_op/equal.go index 9f168e2..9f893f6 100644 --- a/node/expr/binary_op/equal.go +++ b/node/expr/binary_op/equal.go @@ -12,6 +12,7 @@ func NewEqual(variable node.Node, expression node.Node) node.Node { return Equal{ BinaryOp{ "BinaryEqual", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n Equal) Name() string { } func (n Equal) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Equal) Walk(v node.Visitor) { diff --git a/node/expr/binary_op/greater.go b/node/expr/binary_op/greater.go index 704d26e..145a8bf 100644 --- a/node/expr/binary_op/greater.go +++ b/node/expr/binary_op/greater.go @@ -12,6 +12,7 @@ func NewGreater(variable node.Node, expression node.Node) node.Node { return Greater{ BinaryOp{ "BinaryGreater", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n Greater) Name() string { } func (n Greater) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Greater) Walk(v node.Visitor) { diff --git a/node/expr/binary_op/greater_or_equal.go b/node/expr/binary_op/greater_or_equal.go index deb22c4..2777739 100644 --- a/node/expr/binary_op/greater_or_equal.go +++ b/node/expr/binary_op/greater_or_equal.go @@ -12,6 +12,7 @@ func NewGreaterOrEqual(variable node.Node, expression node.Node) node.Node { return GreaterOrEqual{ BinaryOp{ "BinaryGreaterOrEqual", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n GreaterOrEqual) Name() string { } func (n GreaterOrEqual) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n GreaterOrEqual) Walk(v node.Visitor) { diff --git a/node/expr/binary_op/identical.go b/node/expr/binary_op/identical.go index 7eb731f..acec2a9 100644 --- a/node/expr/binary_op/identical.go +++ b/node/expr/binary_op/identical.go @@ -12,6 +12,7 @@ func NewIdentical(variable node.Node, expression node.Node) node.Node { return Identical{ BinaryOp{ "BinaryIdentical", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n Identical) Name() string { } func (n Identical) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Identical) Walk(v node.Visitor) { diff --git a/node/expr/binary_op/logical_and.go b/node/expr/binary_op/logical_and.go index f2a19d7..ec6ef58 100644 --- a/node/expr/binary_op/logical_and.go +++ b/node/expr/binary_op/logical_and.go @@ -12,6 +12,7 @@ func NewLogicalAnd(variable node.Node, expression node.Node) node.Node { return LogicalAnd{ BinaryOp{ "BinaryLogicalAnd", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n LogicalAnd) Name() string { } func (n LogicalAnd) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n LogicalAnd) Walk(v node.Visitor) { diff --git a/node/expr/binary_op/logical_or.go b/node/expr/binary_op/logical_or.go index a049fdd..15c995c 100644 --- a/node/expr/binary_op/logical_or.go +++ b/node/expr/binary_op/logical_or.go @@ -12,6 +12,7 @@ func NewLogicalOr(variable node.Node, expression node.Node) node.Node { return LogicalOr{ BinaryOp{ "BinaryLogicalOr", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n LogicalOr) Name() string { } func (n LogicalOr) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n LogicalOr) Walk(v node.Visitor) { diff --git a/node/expr/binary_op/logical_xor.go b/node/expr/binary_op/logical_xor.go index 21ff258..5b51708 100644 --- a/node/expr/binary_op/logical_xor.go +++ b/node/expr/binary_op/logical_xor.go @@ -12,6 +12,7 @@ func NewLogicalXor(variable node.Node, expression node.Node) node.Node { return LogicalXor{ BinaryOp{ "BinaryLogicalXor", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n LogicalXor) Name() string { } func (n LogicalXor) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n LogicalXor) Walk(v node.Visitor) { diff --git a/node/expr/binary_op/minus.go b/node/expr/binary_op/minus.go index 0fc5b14..7a5a011 100644 --- a/node/expr/binary_op/minus.go +++ b/node/expr/binary_op/minus.go @@ -12,6 +12,7 @@ func NewMinus(variable node.Node, expression node.Node) node.Node { return Minus{ BinaryOp{ "BinaryMinus", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n Minus) Name() string { } func (n Minus) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Minus) Walk(v node.Visitor) { diff --git a/node/expr/binary_op/mod.go b/node/expr/binary_op/mod.go index c795437..dc24cf7 100644 --- a/node/expr/binary_op/mod.go +++ b/node/expr/binary_op/mod.go @@ -12,6 +12,7 @@ func NewMod(variable node.Node, expression node.Node) node.Node { return Mod{ BinaryOp{ "BinaryMod", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n Mod) Name() string { } func (n Mod) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Mod) Walk(v node.Visitor) { diff --git a/node/expr/binary_op/mul.go b/node/expr/binary_op/mul.go index 7878e53..fa2faaa 100644 --- a/node/expr/binary_op/mul.go +++ b/node/expr/binary_op/mul.go @@ -12,6 +12,7 @@ func NewMul(variable node.Node, expression node.Node) node.Node { return Mul{ BinaryOp{ "BinaryMul", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n Mul) Name() string { } func (n Mul) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Mul) Walk(v node.Visitor) { diff --git a/node/expr/binary_op/not_equal.go b/node/expr/binary_op/not_equal.go index 173568a..f5f697b 100644 --- a/node/expr/binary_op/not_equal.go +++ b/node/expr/binary_op/not_equal.go @@ -12,6 +12,7 @@ func NewNotEqual(variable node.Node, expression node.Node) node.Node { return NotEqual{ BinaryOp{ "BinaryNotEqual", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n NotEqual) Name() string { } func (n NotEqual) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n NotEqual) Walk(v node.Visitor) { diff --git a/node/expr/binary_op/not_identical.go b/node/expr/binary_op/not_identical.go index 4e81ba0..52bd110 100644 --- a/node/expr/binary_op/not_identical.go +++ b/node/expr/binary_op/not_identical.go @@ -12,6 +12,7 @@ func NewNotIdentical(variable node.Node, expression node.Node) node.Node { return NotIdentical{ BinaryOp{ "BinaryNotIdentical", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n NotIdentical) Name() string { } func (n NotIdentical) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n NotIdentical) Walk(v node.Visitor) { diff --git a/node/expr/binary_op/plus.go b/node/expr/binary_op/plus.go index bf40f91..7f25a80 100644 --- a/node/expr/binary_op/plus.go +++ b/node/expr/binary_op/plus.go @@ -12,6 +12,7 @@ func NewPlus(variable node.Node, expression node.Node) node.Node { return Plus{ BinaryOp{ "BinaryPlus", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n Plus) Name() string { } func (n Plus) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Plus) Walk(v node.Visitor) { diff --git a/node/expr/binary_op/pow.go b/node/expr/binary_op/pow.go index c97dabb..e610f5b 100644 --- a/node/expr/binary_op/pow.go +++ b/node/expr/binary_op/pow.go @@ -12,6 +12,7 @@ func NewPow(variable node.Node, expression node.Node) node.Node { return Pow{ BinaryOp{ "BinaryPow", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n Pow) Name() string { } func (n Pow) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Pow) Walk(v node.Visitor) { diff --git a/node/expr/binary_op/shift_left.go b/node/expr/binary_op/shift_left.go index f4be34d..d56fae6 100644 --- a/node/expr/binary_op/shift_left.go +++ b/node/expr/binary_op/shift_left.go @@ -12,6 +12,7 @@ func NewShiftLeft(variable node.Node, expression node.Node) node.Node { return ShiftLeft{ BinaryOp{ "BinaryShiftLeft", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n ShiftLeft) Name() string { } func (n ShiftLeft) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n ShiftLeft) Walk(v node.Visitor) { diff --git a/node/expr/binary_op/shift_right.go b/node/expr/binary_op/shift_right.go index 9700449..06fdcd5 100644 --- a/node/expr/binary_op/shift_right.go +++ b/node/expr/binary_op/shift_right.go @@ -12,6 +12,7 @@ func NewShiftRight(variable node.Node, expression node.Node) node.Node { return ShiftRight{ BinaryOp{ "BinaryShiftRight", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n ShiftRight) Name() string { } func (n ShiftRight) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n ShiftRight) Walk(v node.Visitor) { diff --git a/node/expr/binary_op/smaller.go b/node/expr/binary_op/smaller.go index aafe19d..21c70ba 100644 --- a/node/expr/binary_op/smaller.go +++ b/node/expr/binary_op/smaller.go @@ -12,6 +12,7 @@ func NewSmaller(variable node.Node, expression node.Node) node.Node { return Smaller{ BinaryOp{ "BinarySmaller", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n Smaller) Name() string { } func (n Smaller) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Smaller) Walk(v node.Visitor) { diff --git a/node/expr/binary_op/smaller_or_equal.go b/node/expr/binary_op/smaller_or_equal.go index ac3149d..fe60274 100644 --- a/node/expr/binary_op/smaller_or_equal.go +++ b/node/expr/binary_op/smaller_or_equal.go @@ -12,6 +12,7 @@ func NewSmallerOrEqual(variable node.Node, expression node.Node) node.Node { return SmallerOrEqual{ BinaryOp{ "BinarySmallerOrEqual", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n SmallerOrEqual) Name() string { } func (n SmallerOrEqual) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n SmallerOrEqual) Walk(v node.Visitor) { diff --git a/node/expr/binary_op/spaceship.go b/node/expr/binary_op/spaceship.go index e85bd59..2663fcc 100644 --- a/node/expr/binary_op/spaceship.go +++ b/node/expr/binary_op/spaceship.go @@ -12,6 +12,7 @@ func NewSpaceship(variable node.Node, expression node.Node) node.Node { return Spaceship{ BinaryOp{ "BinarySpaceship", + map[string]interface{}{}, variable, expression, }, @@ -23,7 +24,7 @@ func (n Spaceship) Name() string { } func (n Spaceship) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Spaceship) Walk(v node.Visitor) { diff --git a/node/expr/bitwise_not.go b/node/expr/bitwise_not.go index 639d0c7..d3f9c8e 100644 --- a/node/expr/bitwise_not.go +++ b/node/expr/bitwise_not.go @@ -5,13 +5,15 @@ import ( ) type BitwiseNot struct { - name string - expr node.Node + name string + attributes map[string]interface{} + expr node.Node } func NewBitwiseNot(expression node.Node) node.Node { return BitwiseNot{ "BitwiseNot", + map[string]interface{}{}, expression, } } @@ -21,7 +23,7 @@ func (n BitwiseNot) Name() string { } func (n BitwiseNot) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n BitwiseNot) Walk(v node.Visitor) { diff --git a/node/expr/boolean_not.go b/node/expr/boolean_not.go index bbe4b89..ff8d838 100644 --- a/node/expr/boolean_not.go +++ b/node/expr/boolean_not.go @@ -5,13 +5,15 @@ import ( ) type BooleanNot struct { - name string - expr node.Node + name string + attributes map[string]interface{} + expr node.Node } func NewBooleanNot(expression node.Node) node.Node { return BooleanNot{ "BooleanNot", + map[string]interface{}{}, expression, } } @@ -21,7 +23,7 @@ func (n BooleanNot) Name() string { } func (n BooleanNot) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n BooleanNot) Walk(v node.Visitor) { diff --git a/node/expr/cast/cast.go b/node/expr/cast/cast.go index abaeb94..fc0a8c0 100644 --- a/node/expr/cast/cast.go +++ b/node/expr/cast/cast.go @@ -5,6 +5,7 @@ import ( ) type Cast struct { - name string - expr node.Node + name string + attributes map[string]interface{} + expr node.Node } diff --git a/node/expr/cast/cast_array.go b/node/expr/cast/cast_array.go index b0979a5..3287480 100644 --- a/node/expr/cast/cast_array.go +++ b/node/expr/cast/cast_array.go @@ -12,6 +12,7 @@ func NewCastArray(expr node.Node) node.Node { return CastArray{ Cast{ "CastArray", + map[string]interface{}{}, expr, }, } @@ -22,7 +23,7 @@ func (n CastArray) Name() string { } func (n CastArray) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n CastArray) Walk(v node.Visitor) { diff --git a/node/expr/cast/cast_bool.go b/node/expr/cast/cast_bool.go index 232d68f..3e6046e 100644 --- a/node/expr/cast/cast_bool.go +++ b/node/expr/cast/cast_bool.go @@ -12,6 +12,7 @@ func NewCastBool(expr node.Node) node.Node { return CastBool{ Cast{ "CastBool", + map[string]interface{}{}, expr, }, } @@ -22,7 +23,7 @@ func (n CastBool) Name() string { } func (n CastBool) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n CastBool) Walk(v node.Visitor) { diff --git a/node/expr/cast/cast_double.go b/node/expr/cast/cast_double.go index bff4c6d..ee2d258 100644 --- a/node/expr/cast/cast_double.go +++ b/node/expr/cast/cast_double.go @@ -12,6 +12,7 @@ func NewCastDouble(expr node.Node) node.Node { return CastDouble{ Cast{ "CastDouble", + map[string]interface{}{}, expr, }, } @@ -22,7 +23,7 @@ func (n CastDouble) Name() string { } func (n CastDouble) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n CastDouble) Walk(v node.Visitor) { diff --git a/node/expr/cast/cast_int.go b/node/expr/cast/cast_int.go index 143ac81..7834b18 100644 --- a/node/expr/cast/cast_int.go +++ b/node/expr/cast/cast_int.go @@ -12,6 +12,7 @@ func NewCastInt(expr node.Node) node.Node { return CastInt{ Cast{ "CastInt", + map[string]interface{}{}, expr, }, } @@ -22,7 +23,7 @@ func (n CastInt) Name() string { } func (n CastInt) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n CastInt) Walk(v node.Visitor) { diff --git a/node/expr/cast/cast_object.go b/node/expr/cast/cast_object.go index e1d5f72..80838e4 100644 --- a/node/expr/cast/cast_object.go +++ b/node/expr/cast/cast_object.go @@ -12,6 +12,7 @@ func NewCastObject(expr node.Node) node.Node { return CastObject{ Cast{ "CastObject", + map[string]interface{}{}, expr, }, } @@ -22,7 +23,7 @@ func (n CastObject) Name() string { } func (n CastObject) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n CastObject) Walk(v node.Visitor) { diff --git a/node/expr/cast/cast_string.go b/node/expr/cast/cast_string.go index 891a970..4b42c8a 100644 --- a/node/expr/cast/cast_string.go +++ b/node/expr/cast/cast_string.go @@ -12,6 +12,7 @@ func NewCastString(expr node.Node) node.Node { return CastString{ Cast{ "CastString", + map[string]interface{}{}, expr, }, } @@ -22,7 +23,7 @@ func (n CastString) Name() string { } func (n CastString) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n CastString) Walk(v node.Visitor) { diff --git a/node/expr/cast/cast_unset.go b/node/expr/cast/cast_unset.go index ba60af5..1e322ad 100644 --- a/node/expr/cast/cast_unset.go +++ b/node/expr/cast/cast_unset.go @@ -12,6 +12,7 @@ func NewCastUnset(expr node.Node) node.Node { return CastUnset{ Cast{ "CastUnset", + map[string]interface{}{}, expr, }, } @@ -22,7 +23,7 @@ func (n CastUnset) Name() string { } func (n CastUnset) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n CastUnset) Walk(v node.Visitor) { diff --git a/node/expr/class_const_fetch.go b/node/expr/class_const_fetch.go index be1d396..cbd702e 100644 --- a/node/expr/class_const_fetch.go +++ b/node/expr/class_const_fetch.go @@ -5,7 +5,7 @@ import ( ) func (n ClassConstFetch) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n ClassConstFetch) Name() string { @@ -14,6 +14,7 @@ func (n ClassConstFetch) Name() string { type ClassConstFetch struct { name string + attributes map[string]interface{} class node.Node constantName node.Node } @@ -21,6 +22,7 @@ type ClassConstFetch struct { func NewClassConstFetch(class node.Node, constantName node.Node) node.Node { return ClassConstFetch{ "ClassConstFetch", + map[string]interface{}{}, class, constantName, } diff --git a/node/expr/clone.go b/node/expr/clone.go index a6e8b94..3988738 100644 --- a/node/expr/clone.go +++ b/node/expr/clone.go @@ -5,13 +5,15 @@ import ( ) type Clone struct { - name string - expr node.Node + name string + attributes map[string]interface{} + expr node.Node } func NewClone(expression node.Node) node.Node { return Clone{ "Clone", + map[string]interface{}{}, expression, } } @@ -21,7 +23,7 @@ func (n Clone) Name() string { } func (n Clone) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Clone) Walk(v node.Visitor) { diff --git a/node/expr/closure.go b/node/expr/closure.go index b9e7893..25da24d 100644 --- a/node/expr/closure.go +++ b/node/expr/closure.go @@ -32,7 +32,7 @@ func (n Closure) Name() string { } func (n Closure) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Closure) Walk(v node.Visitor) { diff --git a/node/expr/closure_use.go b/node/expr/closure_use.go index b5996e1..8fc1f2f 100644 --- a/node/expr/closure_use.go +++ b/node/expr/closure_use.go @@ -25,7 +25,7 @@ func (n ClusureUse) Name() string { } func (n ClusureUse) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n ClusureUse) Walk(v node.Visitor) { diff --git a/node/expr/const_fetch.go b/node/expr/const_fetch.go index d53c260..6dba0fd 100644 --- a/node/expr/const_fetch.go +++ b/node/expr/const_fetch.go @@ -5,13 +5,15 @@ import ( ) type ConstFetch struct { - name string - constant node.Node + name string + attributes map[string]interface{} + constant node.Node } func NewConstFetch(constant node.Node) node.Node { return ConstFetch{ "ConstFetch", + map[string]interface{}{}, constant, } } @@ -21,7 +23,7 @@ func (n ConstFetch) Name() string { } func (n ConstFetch) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n ConstFetch) Walk(v node.Visitor) { diff --git a/node/expr/empty.go b/node/expr/empty.go index 7f8fbb0..10addd2 100644 --- a/node/expr/empty.go +++ b/node/expr/empty.go @@ -5,13 +5,15 @@ import ( ) type Empty struct { - name string - expr node.Node + name string + attributes map[string]interface{} + expr node.Node } func NewEmpty(expression node.Node) node.Node { return Empty{ "Empty", + map[string]interface{}{}, expression, } } @@ -21,7 +23,7 @@ func (n Empty) Name() string { } func (n Empty) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Empty) Walk(v node.Visitor) { diff --git a/node/expr/error_suppress.go b/node/expr/error_suppress.go index f465a23..32fc614 100644 --- a/node/expr/error_suppress.go +++ b/node/expr/error_suppress.go @@ -5,13 +5,15 @@ import ( ) type ErrorSuppress struct { - name string - expr node.Node + name string + attributes map[string]interface{} + expr node.Node } func NewErrorSuppress(expression node.Node) node.Node { return ErrorSuppress{ "ErrorSuppress", + map[string]interface{}{}, expression, } } @@ -21,7 +23,7 @@ func (n ErrorSuppress) Name() string { } func (n ErrorSuppress) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n ErrorSuppress) Walk(v node.Visitor) { diff --git a/node/expr/eval.go b/node/expr/eval.go index 3289d47..ca849ba 100644 --- a/node/expr/eval.go +++ b/node/expr/eval.go @@ -5,13 +5,15 @@ import ( ) type Eval struct { - name string - expr node.Node + name string + attributes map[string]interface{} + expr node.Node } func NewEval(expression node.Node) node.Node { return Eval{ "Eval", + map[string]interface{}{}, expression, } } @@ -21,7 +23,7 @@ func (n Eval) Name() string { } func (n Eval) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Eval) Walk(v node.Visitor) { diff --git a/node/expr/exit.go b/node/expr/exit.go index ed5c022..b753d23 100644 --- a/node/expr/exit.go +++ b/node/expr/exit.go @@ -25,7 +25,7 @@ func (n Exit) Name() string { } func (n Exit) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Exit) Walk(v node.Visitor) { diff --git a/node/expr/function_call.go b/node/expr/function_call.go index 2d716b1..9511398 100644 --- a/node/expr/function_call.go +++ b/node/expr/function_call.go @@ -5,14 +5,16 @@ import ( ) type FunctionCall struct { - name string - function node.Node - arguments []node.Node + name string + attributes map[string]interface{} + function node.Node + arguments []node.Node } func NewFunctionCall(function node.Node, arguments []node.Node) node.Node { return FunctionCall{ "FunctionCall", + map[string]interface{}{}, function, arguments, } @@ -23,7 +25,7 @@ func (n FunctionCall) Name() string { } func (n FunctionCall) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n FunctionCall) Walk(v node.Visitor) { diff --git a/node/expr/include.go b/node/expr/include.go index a783573..0d2e09d 100644 --- a/node/expr/include.go +++ b/node/expr/include.go @@ -5,13 +5,15 @@ import ( ) type Include struct { - name string - expr node.Node + name string + attributes map[string]interface{} + expr node.Node } func NewInclude(expression node.Node) node.Node { return Include{ "Include", + map[string]interface{}{}, expression, } } @@ -21,7 +23,7 @@ func (n Include) Name() string { } func (n Include) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Include) Walk(v node.Visitor) { diff --git a/node/expr/include_once.go b/node/expr/include_once.go index d09eb13..cdd8c63 100644 --- a/node/expr/include_once.go +++ b/node/expr/include_once.go @@ -5,13 +5,15 @@ import ( ) type IncludeOnce struct { - name string - expr node.Node + name string + attributes map[string]interface{} + expr node.Node } func NewIncludeOnce(expression node.Node) node.Node { return IncludeOnce{ "IncludeOnce", + map[string]interface{}{}, expression, } } @@ -21,7 +23,7 @@ func (n IncludeOnce) Name() string { } func (n IncludeOnce) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n IncludeOnce) Walk(v node.Visitor) { diff --git a/node/expr/instance_of.go b/node/expr/instance_of.go index 55099c3..e4feaa7 100644 --- a/node/expr/instance_of.go +++ b/node/expr/instance_of.go @@ -5,14 +5,16 @@ import ( ) type InstanceOf struct { - name string - expr node.Node - class node.Node + name string + attributes map[string]interface{} + expr node.Node + class node.Node } func NewInstanceOf(expr node.Node, class node.Node) node.Node { return InstanceOf{ "InstanceOf", + map[string]interface{}{}, expr, class, } @@ -23,7 +25,7 @@ func (n InstanceOf) Name() string { } func (n InstanceOf) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n InstanceOf) Walk(v node.Visitor) { diff --git a/node/expr/isset.go b/node/expr/isset.go index f1ee5b4..048c214 100644 --- a/node/expr/isset.go +++ b/node/expr/isset.go @@ -5,13 +5,15 @@ import ( ) type Isset struct { - name string - variables []node.Node + name string + attributes map[string]interface{} + variables []node.Node } func NewIsset(variables []node.Node) node.Node { return Isset{ "Isset", + map[string]interface{}{}, variables, } } @@ -21,7 +23,7 @@ func (n Isset) Name() string { } func (n Isset) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Isset) Walk(v node.Visitor) { diff --git a/node/expr/list.go b/node/expr/list.go index b07bbea..0877374 100644 --- a/node/expr/list.go +++ b/node/expr/list.go @@ -5,13 +5,15 @@ import ( ) type List struct { - name string - items []node.Node + name string + attributes map[string]interface{} + items []node.Node } func NewList(items []node.Node) node.Node { return List{ "List", + map[string]interface{}{}, items, } } @@ -21,7 +23,7 @@ func (n List) Name() string { } func (n List) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n List) Walk(v node.Visitor) { diff --git a/node/expr/method_call.go b/node/expr/method_call.go index ff9358c..0750016 100644 --- a/node/expr/method_call.go +++ b/node/expr/method_call.go @@ -5,15 +5,17 @@ import ( ) type MethodCall struct { - name string - variable node.Node - method node.Node - arguments []node.Node + name string + attributes map[string]interface{} + variable node.Node + method node.Node + arguments []node.Node } func NewMethodCall(variable node.Node, method node.Node, arguments []node.Node) node.Node { return MethodCall{ "MethodCall", + map[string]interface{}{}, variable, method, arguments, @@ -25,7 +27,7 @@ func (n MethodCall) Name() string { } func (n MethodCall) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n MethodCall) Walk(v node.Visitor) { diff --git a/node/expr/new.go b/node/expr/new.go index a07c7ba..1f56a73 100644 --- a/node/expr/new.go +++ b/node/expr/new.go @@ -5,14 +5,16 @@ import ( ) type New struct { - name string - class node.Node - arguments []node.Node + name string + attributes map[string]interface{} + class node.Node + arguments []node.Node } func NewNew(class node.Node, arguments []node.Node) node.Node { return New{ "New", + map[string]interface{}{}, class, arguments, } @@ -23,7 +25,7 @@ func (n New) Name() string { } func (n New) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n New) Walk(v node.Visitor) { diff --git a/node/expr/post_dec.go b/node/expr/post_dec.go index fc45364..a72c4a2 100644 --- a/node/expr/post_dec.go +++ b/node/expr/post_dec.go @@ -5,13 +5,15 @@ import ( ) type PostDec struct { - name string - variable node.Node + name string + attributes map[string]interface{} + variable node.Node } func NewPostDec(variable node.Node) node.Node { return PostDec{ "PostDec", + map[string]interface{}{}, variable, } } @@ -21,7 +23,7 @@ func (n PostDec) Name() string { } func (n PostDec) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n PostDec) Walk(v node.Visitor) { diff --git a/node/expr/post_inc.go b/node/expr/post_inc.go index d040f9a..807996c 100644 --- a/node/expr/post_inc.go +++ b/node/expr/post_inc.go @@ -5,13 +5,15 @@ import ( ) type PostInc struct { - name string - variable node.Node + name string + attributes map[string]interface{} + variable node.Node } func NewPostInc(variable node.Node) node.Node { return PostInc{ "PostInc", + map[string]interface{}{}, variable, } } @@ -21,7 +23,7 @@ func (n PostInc) Name() string { } func (n PostInc) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n PostInc) Walk(v node.Visitor) { diff --git a/node/expr/pre_dec.go b/node/expr/pre_dec.go index c1eac0a..89d9e8e 100644 --- a/node/expr/pre_dec.go +++ b/node/expr/pre_dec.go @@ -5,13 +5,15 @@ import ( ) type PreDec struct { - name string - variable node.Node + name string + attributes map[string]interface{} + variable node.Node } func NewPreDec(variable node.Node) node.Node { return PreDec{ "PreDec", + map[string]interface{}{}, variable, } } @@ -21,7 +23,7 @@ func (n PreDec) Name() string { } func (n PreDec) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n PreDec) Walk(v node.Visitor) { diff --git a/node/expr/pre_inc.go b/node/expr/pre_inc.go index 18113d5..8139e41 100644 --- a/node/expr/pre_inc.go +++ b/node/expr/pre_inc.go @@ -5,13 +5,15 @@ import ( ) type PreInc struct { - name string - variable node.Node + name string + attributes map[string]interface{} + variable node.Node } func NewPreInc(variable node.Node) node.Node { return PreInc{ "PreInc", + map[string]interface{}{}, variable, } } @@ -21,7 +23,7 @@ func (n PreInc) Name() string { } func (n PreInc) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n PreInc) Walk(v node.Visitor) { diff --git a/node/expr/print.go b/node/expr/print.go index 7706421..857befd 100644 --- a/node/expr/print.go +++ b/node/expr/print.go @@ -5,13 +5,15 @@ import ( ) type Print struct { - name string - expr node.Node + name string + attributes map[string]interface{} + expr node.Node } func NewPrint(expression node.Node) node.Node { return Print{ "Print", + map[string]interface{}{}, expression, } } @@ -21,7 +23,7 @@ func (n Print) Name() string { } func (n Print) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Print) Walk(v node.Visitor) { diff --git a/node/expr/property_fetch.go b/node/expr/property_fetch.go index 718586c..f235719 100644 --- a/node/expr/property_fetch.go +++ b/node/expr/property_fetch.go @@ -5,14 +5,16 @@ import ( ) type PropertyFetch struct { - name string - variable node.Node - property node.Node + name string + attributes map[string]interface{} + variable node.Node + property node.Node } func NewPropertyFetch(variable node.Node, property node.Node) node.Node { return PropertyFetch{ "PropertyFetch", + map[string]interface{}{}, variable, property, } @@ -23,7 +25,7 @@ func (n PropertyFetch) Name() string { } func (n PropertyFetch) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n PropertyFetch) Walk(v node.Visitor) { diff --git a/node/expr/require.go b/node/expr/require.go index 256bc9e..99f8c69 100644 --- a/node/expr/require.go +++ b/node/expr/require.go @@ -5,13 +5,15 @@ import ( ) type Require struct { - name string - expr node.Node + name string + attributes map[string]interface{} + expr node.Node } func NewRequire(expression node.Node) node.Node { return Require{ "Require", + map[string]interface{}{}, expression, } } @@ -21,7 +23,7 @@ func (n Require) Name() string { } func (n Require) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Require) Walk(v node.Visitor) { diff --git a/node/expr/require_once.go b/node/expr/require_once.go index b1cac07..965dfe5 100644 --- a/node/expr/require_once.go +++ b/node/expr/require_once.go @@ -5,13 +5,15 @@ import ( ) type RequireOnce struct { - name string - expr node.Node + name string + attributes map[string]interface{} + expr node.Node } func NewRequireOnce(expression node.Node) node.Node { return RequireOnce{ "RequireOnce", + map[string]interface{}{}, expression, } } @@ -21,7 +23,7 @@ func (n RequireOnce) Name() string { } func (n RequireOnce) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n RequireOnce) Walk(v node.Visitor) { diff --git a/node/expr/shell_exec.go b/node/expr/shell_exec.go index 07f3738..21c58e5 100644 --- a/node/expr/shell_exec.go +++ b/node/expr/shell_exec.go @@ -5,13 +5,15 @@ import ( ) type ShellExec struct { - name string - parts []node.Node + name string + attributes map[string]interface{} + parts []node.Node } func NewShellExec(parts []node.Node) node.Node { return ShellExec{ "ShellExec", + map[string]interface{}{}, parts, } } @@ -21,7 +23,7 @@ func (n ShellExec) Name() string { } func (n ShellExec) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n ShellExec) Walk(v node.Visitor) { diff --git a/node/expr/short_array.go b/node/expr/short_array.go index cf8ee39..af1f8e8 100644 --- a/node/expr/short_array.go +++ b/node/expr/short_array.go @@ -5,13 +5,15 @@ import ( ) type ShortArray struct { - name string - items []node.Node + name string + attributes map[string]interface{} + items []node.Node } func NewShortArray(items []node.Node) node.Node { return ShortArray{ "ShortArray", + map[string]interface{}{}, items, } } @@ -21,7 +23,7 @@ func (n ShortArray) Name() string { } func (n ShortArray) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n ShortArray) Walk(v node.Visitor) { diff --git a/node/expr/short_list.go b/node/expr/short_list.go index d31b94a..cbf7a72 100644 --- a/node/expr/short_list.go +++ b/node/expr/short_list.go @@ -5,13 +5,15 @@ import ( ) type ShortList struct { - name string - items []node.Node + name string + attributes map[string]interface{} + items []node.Node } func NewShortList(items []node.Node) node.Node { return ShortList{ "ShortList", + map[string]interface{}{}, items, } } @@ -21,7 +23,7 @@ func (n ShortList) Name() string { } func (n ShortList) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n ShortList) Walk(v node.Visitor) { diff --git a/node/expr/static_call.go b/node/expr/static_call.go index e1804dc..fb45fda 100644 --- a/node/expr/static_call.go +++ b/node/expr/static_call.go @@ -5,15 +5,17 @@ import ( ) type StaticCall struct { - name string - class node.Node - call node.Node - arguments []node.Node + name string + attributes map[string]interface{} + class node.Node + call node.Node + arguments []node.Node } func NewStaticCall(class node.Node, call node.Node, arguments []node.Node) node.Node { return StaticCall{ "StaticCall", + map[string]interface{}{}, class, call, arguments, @@ -25,7 +27,7 @@ func (n StaticCall) Name() string { } func (n StaticCall) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n StaticCall) Walk(v node.Visitor) { diff --git a/node/expr/static_property_fetch.go b/node/expr/static_property_fetch.go index 7a17097..4b4a5c5 100644 --- a/node/expr/static_property_fetch.go +++ b/node/expr/static_property_fetch.go @@ -5,14 +5,16 @@ import ( ) type StaticPropertyFetch struct { - name string - class node.Node - property node.Node + name string + attributes map[string]interface{} + class node.Node + property node.Node } func NewStaticPropertyFetch(class node.Node, property node.Node) node.Node { return StaticPropertyFetch{ "StaticPropertyFetch", + map[string]interface{}{}, class, property, } @@ -23,7 +25,7 @@ func (n StaticPropertyFetch) Name() string { } func (n StaticPropertyFetch) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n StaticPropertyFetch) Walk(v node.Visitor) { diff --git a/node/expr/ternary.go b/node/expr/ternary.go index 872cf0a..880f288 100644 --- a/node/expr/ternary.go +++ b/node/expr/ternary.go @@ -5,15 +5,17 @@ import ( ) type Ternary struct { - name string - condition node.Node - ifTrue node.Node - ifFalse node.Node + name string + attributes map[string]interface{} + condition node.Node + ifTrue node.Node + ifFalse node.Node } func NewTernary(condition node.Node, ifTrue node.Node, ifFalse node.Node) node.Node { return Ternary{ "Ternary", + map[string]interface{}{}, condition, ifTrue, ifFalse, @@ -25,7 +27,7 @@ func (n Ternary) Name() string { } func (n Ternary) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Ternary) Walk(v node.Visitor) { diff --git a/node/expr/unary_minus.go b/node/expr/unary_minus.go index 7453098..76f252a 100644 --- a/node/expr/unary_minus.go +++ b/node/expr/unary_minus.go @@ -5,13 +5,15 @@ import ( ) type UnaryMinus struct { - name string - expr node.Node + name string + attributes map[string]interface{} + expr node.Node } func NewUnaryMinus(expression node.Node) node.Node { return UnaryMinus{ "UnaryMinus", + map[string]interface{}{}, expression, } } @@ -21,7 +23,7 @@ func (n UnaryMinus) Name() string { } func (n UnaryMinus) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n UnaryMinus) Walk(v node.Visitor) { diff --git a/node/expr/unary_plus.go b/node/expr/unary_plus.go index 571627b..739d63b 100644 --- a/node/expr/unary_plus.go +++ b/node/expr/unary_plus.go @@ -5,13 +5,15 @@ import ( ) type UnaryPlus struct { - name string - expr node.Node + name string + attributes map[string]interface{} + expr node.Node } func NewUnaryPlus(expression node.Node) node.Node { return UnaryPlus{ "UnaryPlus", + map[string]interface{}{}, expression, } } @@ -21,7 +23,7 @@ func (n UnaryPlus) Name() string { } func (n UnaryPlus) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n UnaryPlus) Walk(v node.Visitor) { diff --git a/node/expr/variable.go b/node/expr/variable.go index d3ba182..9812bdd 100644 --- a/node/expr/variable.go +++ b/node/expr/variable.go @@ -5,13 +5,15 @@ import ( ) type Variable struct { - name string - varName node.Node + name string + attributes map[string]interface{} + varName node.Node } func NewVariable(varName node.Node) node.Node { return Variable{ "Variable", + map[string]interface{}{}, varName, } } @@ -21,7 +23,7 @@ func (n Variable) Name() string { } func (n Variable) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Variable) Walk(v node.Visitor) { diff --git a/node/expr/yield.go b/node/expr/yield.go index 6a51f4e..64d4816 100644 --- a/node/expr/yield.go +++ b/node/expr/yield.go @@ -5,14 +5,16 @@ import ( ) type Yield struct { - name string - key node.Node - value node.Node + name string + attributes map[string]interface{} + key node.Node + value node.Node } func NewYield(key node.Node, value node.Node) node.Node { return Yield{ "Yield", + map[string]interface{}{}, key, value, } @@ -23,7 +25,7 @@ func (n Yield) Name() string { } func (n Yield) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Yield) Walk(v node.Visitor) { diff --git a/node/expr/yield_from.go b/node/expr/yield_from.go index 92c26f4..11de4d4 100644 --- a/node/expr/yield_from.go +++ b/node/expr/yield_from.go @@ -5,13 +5,15 @@ import ( ) type YieldFrom struct { - name string - expr node.Node + name string + attributes map[string]interface{} + expr node.Node } func NewYieldFrom(expression node.Node) node.Node { return YieldFrom{ "YieldFrom", + map[string]interface{}{}, expression, } } @@ -21,7 +23,7 @@ func (n YieldFrom) Name() string { } func (n YieldFrom) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n YieldFrom) Walk(v node.Visitor) { diff --git a/node/name/fully_qualified.go b/node/name/fully_qualified.go index a18ea5c..76ab231 100644 --- a/node/name/fully_qualified.go +++ b/node/name/fully_qualified.go @@ -12,6 +12,7 @@ func NewFullyQualified(parts []node.Node) node.Node { return FullyQualified{ NameNode{ "FullyQualifiedName", + map[string]interface{}{}, parts, }, } @@ -22,5 +23,5 @@ func (n FullyQualified) Name() string { } func (n FullyQualified) Attributes() map[string]interface{} { - return nil + return n.attributes } diff --git a/node/name/name.go b/node/name/name.go index eb0c601..036592b 100644 --- a/node/name/name.go +++ b/node/name/name.go @@ -5,13 +5,15 @@ import ( ) type NameNode struct { - name string - parts []node.Node + name string + attributes map[string]interface{} + parts []node.Node } func NewName(parts []node.Node) node.Node { return NameNode{ "Name", + map[string]interface{}{}, parts, } } @@ -21,7 +23,7 @@ func (n NameNode) Name() string { } func (n NameNode) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n NameNode) Walk(v node.Visitor) { diff --git a/node/name/relative.go b/node/name/relative.go index de58ba4..bb17d2d 100644 --- a/node/name/relative.go +++ b/node/name/relative.go @@ -12,6 +12,7 @@ func NewRelative(parts []node.Node) node.Node { return Relative{ NameNode{ "RelativeName", + map[string]interface{}{}, parts, }, } @@ -22,5 +23,5 @@ func (n Relative) Name() string { } func (n Relative) Attributes() map[string]interface{} { - return nil + return n.attributes } diff --git a/node/nullable.go b/node/nullable.go index a1675d9..d8b425d 100644 --- a/node/nullable.go +++ b/node/nullable.go @@ -1,13 +1,15 @@ package node type Nullable struct { - name string - expr Node + name string + attributes map[string]interface{} + expr Node } func NewNullable(expression Node) Node { return Nullable{ "Nullable", + map[string]interface{}{}, expression, } } @@ -17,7 +19,7 @@ func (n Nullable) Name() string { } func (n Nullable) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Nullable) Walk(v Visitor) { diff --git a/node/scalar/dnumber.go b/node/scalar/dnumber.go index eb59e30..e787cfa 100644 --- a/node/scalar/dnumber.go +++ b/node/scalar/dnumber.go @@ -23,7 +23,7 @@ func (n Dnumber) Name() string { } func (n Dnumber) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Dnumber) Walk(v node.Visitor) { diff --git a/node/scalar/encapsed.go b/node/scalar/encapsed.go index 868e566..72dc22b 100644 --- a/node/scalar/encapsed.go +++ b/node/scalar/encapsed.go @@ -5,13 +5,15 @@ import ( ) type Encapsed struct { - name string - parts []node.Node + name string + attributes map[string]interface{} + parts []node.Node } func NewEncapsed(parts []node.Node) node.Node { return Encapsed{ "Encapsed", + map[string]interface{}{}, parts, } } @@ -21,7 +23,7 @@ func (n Encapsed) Name() string { } func (n Encapsed) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Encapsed) Walk(v node.Visitor) { diff --git a/node/scalar/encapsed_string_part.go b/node/scalar/encapsed_string_part.go index 62011af..6fe73c5 100644 --- a/node/scalar/encapsed_string_part.go +++ b/node/scalar/encapsed_string_part.go @@ -23,7 +23,7 @@ func (n EncapsedStringPart) Name() string { } func (n EncapsedStringPart) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n EncapsedStringPart) Walk(v node.Visitor) { diff --git a/node/scalar/lnumber.go b/node/scalar/lnumber.go index 1b79a03..1327a00 100644 --- a/node/scalar/lnumber.go +++ b/node/scalar/lnumber.go @@ -23,7 +23,7 @@ func (n Lnumber) Name() string { } func (n Lnumber) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Lnumber) Walk(v node.Visitor) { diff --git a/node/scalar/magic_constant.go b/node/scalar/magic_constant.go index 44a3fcd..cb14ddb 100644 --- a/node/scalar/magic_constant.go +++ b/node/scalar/magic_constant.go @@ -23,7 +23,7 @@ func (n MagicConstant) Name() string { } func (n MagicConstant) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n MagicConstant) Walk(v node.Visitor) { diff --git a/node/scalar/string.go b/node/scalar/string.go index 5134f4c..bfadf01 100644 --- a/node/scalar/string.go +++ b/node/scalar/string.go @@ -24,7 +24,7 @@ func (n String) Name() string { } func (n String) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n String) Walk(v node.Visitor) { diff --git a/node/stmt/alt_else.go b/node/stmt/alt_else.go index f2195ab..c417ef1 100644 --- a/node/stmt/alt_else.go +++ b/node/stmt/alt_else.go @@ -5,13 +5,15 @@ import ( ) type AltElse struct { - name string - stmt node.Node + name string + attributes map[string]interface{} + stmt node.Node } func NewAltElse(stmt node.Node) node.Node { return AltElse{ "AltElse", + map[string]interface{}{}, stmt, } } @@ -21,7 +23,7 @@ func (n AltElse) Name() string { } func (n AltElse) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n AltElse) Walk(v node.Visitor) { diff --git a/node/stmt/alt_else_if.go b/node/stmt/alt_else_if.go index 5b63a55..ebac101 100644 --- a/node/stmt/alt_else_if.go +++ b/node/stmt/alt_else_if.go @@ -5,14 +5,16 @@ import ( ) type AltElseIf struct { - name string - cond node.Node - stmt node.Node + name string + attributes map[string]interface{} + cond node.Node + stmt node.Node } func NewAltElseIf(cond node.Node, stmt node.Node) node.Node { return AltElseIf{ "AltElseIf", + map[string]interface{}{}, cond, stmt, } @@ -23,7 +25,7 @@ func (n AltElseIf) Name() string { } func (n AltElseIf) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n AltElseIf) Walk(v node.Visitor) { diff --git a/node/stmt/alt_if.go b/node/stmt/alt_if.go index 62aaaa6..e0cf945 100644 --- a/node/stmt/alt_if.go +++ b/node/stmt/alt_if.go @@ -5,16 +5,18 @@ import ( ) type AltIf struct { - name string - cond node.Node - stmt node.Node - elseIf []node.Node - _else node.Node + name string + attributes map[string]interface{} + cond node.Node + stmt node.Node + elseIf []node.Node + _else node.Node } func NewAltIf(cond node.Node, stmt node.Node) node.Node { return AltIf{ "AltIf", + map[string]interface{}{}, cond, stmt, nil, @@ -27,7 +29,7 @@ func (n AltIf) Name() string { } func (n AltIf) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n AltIf) AddElseIf(elseIf node.Node) node.Node { diff --git a/node/stmt/break.go b/node/stmt/break.go index d6c1e97..2fcf670 100644 --- a/node/stmt/break.go +++ b/node/stmt/break.go @@ -5,13 +5,15 @@ import ( ) type Break struct { - name string - expr node.Node + name string + attributes map[string]interface{} + expr node.Node } func NewBreak(expr node.Node) node.Node { return Break{ "Break", + map[string]interface{}{}, expr, } } @@ -21,7 +23,7 @@ func (n Break) Name() string { } func (n Break) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Break) Walk(v node.Visitor) { diff --git a/node/stmt/case.go b/node/stmt/case.go index f29ea67..45a9fe9 100644 --- a/node/stmt/case.go +++ b/node/stmt/case.go @@ -5,14 +5,16 @@ import ( ) type Case struct { - name string - cond node.Node - stmts []node.Node + name string + attributes map[string]interface{} + cond node.Node + stmts []node.Node } func NewCase(cond node.Node, stmts []node.Node) node.Node { return Case{ "Case", + map[string]interface{}{}, cond, stmts, } @@ -23,7 +25,7 @@ func (n Case) Name() string { } func (n Case) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Case) Walk(v node.Visitor) { diff --git a/node/stmt/catch.go b/node/stmt/catch.go index 859c75f..b12563a 100644 --- a/node/stmt/catch.go +++ b/node/stmt/catch.go @@ -5,15 +5,17 @@ import ( ) type Catch struct { - name string - types []node.Node - variable node.Node - stmts []node.Node + name string + attributes map[string]interface{} + types []node.Node + variable node.Node + stmts []node.Node } func NewCatch(types []node.Node, variable node.Node, stmts []node.Node) node.Node { return Catch{ "Catch", + map[string]interface{}{}, types, variable, stmts, @@ -25,7 +27,7 @@ func (n Catch) Name() string { } func (n Catch) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Catch) Walk(v node.Visitor) { diff --git a/node/stmt/class.go b/node/stmt/class.go index 1cbb6b4..b73ddba 100644 --- a/node/stmt/class.go +++ b/node/stmt/class.go @@ -6,6 +6,7 @@ import ( type Class struct { name string + attributes map[string]interface{} className node.Node modifiers []node.Node args []node.Node @@ -17,6 +18,7 @@ type Class struct { func NewClass(className node.Node, modifiers []node.Node, args []node.Node, extends node.Node, implements []node.Node, stmts []node.Node) node.Node { return Class{ "Class", + map[string]interface{}{}, className, modifiers, args, @@ -31,7 +33,7 @@ func (n Class) Name() string { } func (n Class) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Class) Walk(v node.Visitor) { diff --git a/node/stmt/class_const_list.go b/node/stmt/class_const_list.go index 4ba106c..252f7df 100644 --- a/node/stmt/class_const_list.go +++ b/node/stmt/class_const_list.go @@ -5,14 +5,16 @@ import ( ) type ClassConstList struct { - name string - modifiers []node.Node - consts []node.Node + name string + attributes map[string]interface{} + modifiers []node.Node + consts []node.Node } func NewClassConstList(modifiers []node.Node, consts []node.Node) node.Node { return ClassConstList{ "ClassConstList", + map[string]interface{}{}, modifiers, consts, } @@ -23,7 +25,7 @@ func (n ClassConstList) Name() string { } func (n ClassConstList) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n ClassConstList) Walk(v node.Visitor) { diff --git a/node/stmt/class_method.go b/node/stmt/class_method.go index e2cdc68..45af768 100644 --- a/node/stmt/class_method.go +++ b/node/stmt/class_method.go @@ -33,7 +33,7 @@ func (n ClassMethod) Name() string { } func (n ClassMethod) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n ClassMethod) Walk(v node.Visitor) { diff --git a/node/stmt/const_list.go b/node/stmt/const_list.go index cc85b59..ce051b3 100644 --- a/node/stmt/const_list.go +++ b/node/stmt/const_list.go @@ -5,13 +5,15 @@ import ( ) type ConstList struct { - name string - consts []node.Node + name string + attributes map[string]interface{} + consts []node.Node } func NewConstList(consts []node.Node) node.Node { return ConstList{ "ConstList", + map[string]interface{}{}, consts, } } @@ -21,7 +23,7 @@ func (n ConstList) Name() string { } func (n ConstList) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n ConstList) Walk(v node.Visitor) { diff --git a/node/stmt/constant.go b/node/stmt/constant.go index 572a51a..dd1424d 100644 --- a/node/stmt/constant.go +++ b/node/stmt/constant.go @@ -6,6 +6,7 @@ import ( type Constant struct { name string + attributes map[string]interface{} constantName node.Node expr node.Node } @@ -13,6 +14,7 @@ type Constant struct { func NewConstant(constantName node.Node, expr node.Node) node.Node { return Constant{ "Constant", + map[string]interface{}{}, constantName, expr, } @@ -23,7 +25,7 @@ func (n Constant) Name() string { } func (n Constant) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Constant) Walk(v node.Visitor) { diff --git a/node/stmt/continue.go b/node/stmt/continue.go index f00936d..528ffd4 100644 --- a/node/stmt/continue.go +++ b/node/stmt/continue.go @@ -5,13 +5,15 @@ import ( ) type Continue struct { - name string - expr node.Node + name string + attributes map[string]interface{} + expr node.Node } func NewContinue(expr node.Node) node.Node { return Continue{ "Continue", + map[string]interface{}{}, expr, } } @@ -21,7 +23,7 @@ func (n Continue) Name() string { } func (n Continue) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Continue) Walk(v node.Visitor) { diff --git a/node/stmt/declare.go b/node/stmt/declare.go index 41b4b49..b9d8de0 100644 --- a/node/stmt/declare.go +++ b/node/stmt/declare.go @@ -5,14 +5,16 @@ import ( ) type Declare struct { - name string - consts []node.Node - stmt node.Node + name string + attributes map[string]interface{} + consts []node.Node + stmt node.Node } func NewDeclare(consts []node.Node, stmt node.Node) node.Node { return Declare{ "Declare", + map[string]interface{}{}, consts, stmt, } @@ -23,7 +25,7 @@ func (n Declare) Name() string { } func (n Declare) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Declare) Walk(v node.Visitor) { diff --git a/node/stmt/default.go b/node/stmt/default.go index b95233b..4edfd9d 100644 --- a/node/stmt/default.go +++ b/node/stmt/default.go @@ -5,13 +5,15 @@ import ( ) type Default struct { - name string - stmts []node.Node + name string + attributes map[string]interface{} + stmts []node.Node } func NewDefault(stmts []node.Node) node.Node { return Default{ "Default", + map[string]interface{}{}, stmts, } } @@ -21,7 +23,7 @@ func (n Default) Name() string { } func (n Default) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Default) Walk(v node.Visitor) { diff --git a/node/stmt/do.go b/node/stmt/do.go index 372dd04..c68a01f 100644 --- a/node/stmt/do.go +++ b/node/stmt/do.go @@ -5,14 +5,16 @@ import ( ) type Do struct { - name string - stmt node.Node - cond node.Node + name string + attributes map[string]interface{} + stmt node.Node + cond node.Node } func NewDo(stmt node.Node, cond node.Node) node.Node { return Do{ "Do", + map[string]interface{}{}, stmt, cond, } @@ -23,7 +25,7 @@ func (n Do) Name() string { } func (n Do) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Do) Walk(v node.Visitor) { diff --git a/node/stmt/echo.go b/node/stmt/echo.go index 35a85b2..e7c4651 100644 --- a/node/stmt/echo.go +++ b/node/stmt/echo.go @@ -5,13 +5,15 @@ import ( ) type Echo struct { - name string - exprs []node.Node + name string + attributes map[string]interface{} + exprs []node.Node } func NewEcho(exprs []node.Node) node.Node { return Echo{ "Echo", + map[string]interface{}{}, exprs, } } @@ -21,7 +23,7 @@ func (n Echo) Name() string { } func (n Echo) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Echo) Walk(v node.Visitor) { diff --git a/node/stmt/else.go b/node/stmt/else.go index 84c27a6..d12a62c 100644 --- a/node/stmt/else.go +++ b/node/stmt/else.go @@ -5,13 +5,15 @@ import ( ) type Else struct { - name string - stmt node.Node + name string + attributes map[string]interface{} + stmt node.Node } func NewElse(stmt node.Node) node.Node { return Else{ "Else", + map[string]interface{}{}, stmt, } } @@ -21,7 +23,7 @@ func (n Else) Name() string { } func (n Else) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Else) Walk(v node.Visitor) { diff --git a/node/stmt/else_if.go b/node/stmt/else_if.go index 85cf49d..1b0fcca 100644 --- a/node/stmt/else_if.go +++ b/node/stmt/else_if.go @@ -5,14 +5,16 @@ import ( ) type ElseIf struct { - name string - cond node.Node - stmt node.Node + name string + attributes map[string]interface{} + cond node.Node + stmt node.Node } func NewElseIf(cond node.Node, stmt node.Node) node.Node { return ElseIf{ "ElseIf", + map[string]interface{}{}, cond, stmt, } @@ -23,7 +25,7 @@ func (n ElseIf) Name() string { } func (n ElseIf) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n ElseIf) Walk(v node.Visitor) { diff --git a/node/stmt/expression.go b/node/stmt/expression.go index 7f28d93..cff348e 100644 --- a/node/stmt/expression.go +++ b/node/stmt/expression.go @@ -5,13 +5,15 @@ import ( ) type Expression struct { - name string - expr node.Node + name string + attributes map[string]interface{} + expr node.Node } func NewExpression(expr node.Node) node.Node { return Expression{ "Expression", + map[string]interface{}{}, expr, } } @@ -21,7 +23,7 @@ func (n Expression) Name() string { } func (n Expression) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Expression) Walk(v node.Visitor) { diff --git a/node/stmt/finally.go b/node/stmt/finally.go index 016f341..5af5221 100644 --- a/node/stmt/finally.go +++ b/node/stmt/finally.go @@ -5,13 +5,15 @@ import ( ) type Finally struct { - name string - stmts []node.Node + name string + attributes map[string]interface{} + stmts []node.Node } func NewFinally(stmts []node.Node) node.Node { return Finally{ "Finally", + map[string]interface{}{}, stmts, } } @@ -21,7 +23,7 @@ func (n Finally) Name() string { } func (n Finally) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Finally) Walk(v node.Visitor) { diff --git a/node/stmt/for.go b/node/stmt/for.go index 900d951..5af930d 100644 --- a/node/stmt/for.go +++ b/node/stmt/for.go @@ -5,16 +5,18 @@ import ( ) type For struct { - name string - init []node.Node - cond []node.Node - loop []node.Node - stmt node.Node + name string + attributes map[string]interface{} + 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 { return For{ "For", + map[string]interface{}{}, init, cond, loop, @@ -27,7 +29,7 @@ func (n For) Name() string { } func (n For) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n For) Walk(v node.Visitor) { diff --git a/node/stmt/global.go b/node/stmt/global.go index 531e432..ca47179 100644 --- a/node/stmt/global.go +++ b/node/stmt/global.go @@ -5,13 +5,15 @@ import ( ) type Global struct { - name string - vars []node.Node + name string + attributes map[string]interface{} + vars []node.Node } func NewGlobal(vars []node.Node) node.Node { return Global{ "Global", + map[string]interface{}{}, vars, } } @@ -21,7 +23,7 @@ func (n Global) Name() string { } func (n Global) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Global) Walk(v node.Visitor) { diff --git a/node/stmt/goto.go b/node/stmt/goto.go index a62184b..5c9c949 100644 --- a/node/stmt/goto.go +++ b/node/stmt/goto.go @@ -5,13 +5,15 @@ import ( ) type Goto struct { - name string - label node.Node + name string + attributes map[string]interface{} + label node.Node } func NewGoto(label node.Node) node.Node { return Goto{ "Goto", + map[string]interface{}{}, label, } } @@ -21,7 +23,7 @@ func (n Goto) Name() string { } func (n Goto) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Goto) Walk(v node.Visitor) { diff --git a/node/stmt/group_use.go b/node/stmt/group_use.go index 5154dad..23af26f 100644 --- a/node/stmt/group_use.go +++ b/node/stmt/group_use.go @@ -5,15 +5,17 @@ import ( ) type GroupUse struct { - name string - useType node.Node - prefix node.Node - useList []node.Node + name string + attributes map[string]interface{} + useType node.Node + prefix node.Node + useList []node.Node } func NewGroupUse(useType node.Node, prefix node.Node, useList []node.Node) node.Node { return GroupUse{ "GroupUse", + map[string]interface{}{}, useType, prefix, useList, @@ -25,7 +27,7 @@ func (n GroupUse) Name() string { } func (n GroupUse) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n GroupUse) SetUseType(useType node.Node) node.Node { diff --git a/node/stmt/halt_compiler.go b/node/stmt/halt_compiler.go index 91e2889..ee24a6e 100644 --- a/node/stmt/halt_compiler.go +++ b/node/stmt/halt_compiler.go @@ -5,12 +5,14 @@ import ( ) type HaltCompiler struct { - name string + name string + attributes map[string]interface{} } func NewHaltCompiler() node.Node { return HaltCompiler{ "HaltCompiler", + map[string]interface{}{}, } } @@ -19,7 +21,7 @@ func (n HaltCompiler) Name() string { } func (n HaltCompiler) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n HaltCompiler) Walk(v node.Visitor) { diff --git a/node/stmt/if.go b/node/stmt/if.go index f19a7b8..bb55acb 100644 --- a/node/stmt/if.go +++ b/node/stmt/if.go @@ -5,16 +5,18 @@ import ( ) type If struct { - name string - cond node.Node - stmt node.Node - elseIf []node.Node - _else node.Node + name string + attributes map[string]interface{} + cond node.Node + stmt node.Node + elseIf []node.Node + _else node.Node } func NewIf(cond node.Node, stmt node.Node) node.Node { return If{ "If", + map[string]interface{}{}, cond, stmt, nil, @@ -27,7 +29,7 @@ func (n If) Name() string { } func (n If) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n If) AddElseIf(elseIf node.Node) node.Node { diff --git a/node/stmt/interface.go b/node/stmt/interface.go index 8c79ad7..5d3553f 100644 --- a/node/stmt/interface.go +++ b/node/stmt/interface.go @@ -6,6 +6,7 @@ import ( type Interface struct { name string + attributes map[string]interface{} interfaceName node.Node extends []node.Node stmts []node.Node @@ -14,6 +15,7 @@ type Interface struct { func NewInterface(interfaceName node.Node, extends []node.Node, stmts []node.Node) node.Node { return Interface{ "Interface", + map[string]interface{}{}, interfaceName, extends, stmts, @@ -25,7 +27,7 @@ func (n Interface) Name() string { } func (n Interface) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Interface) Walk(v node.Visitor) { diff --git a/node/stmt/label.go b/node/stmt/label.go index 1ef3f72..cd12738 100644 --- a/node/stmt/label.go +++ b/node/stmt/label.go @@ -5,13 +5,15 @@ import ( ) type Label struct { - name string - labelName node.Node + name string + attributes map[string]interface{} + labelName node.Node } func NewLabel(labelName node.Node) node.Node { return Label{ "Label", + map[string]interface{}{}, labelName, } } @@ -21,7 +23,7 @@ func (n Label) Name() string { } func (n Label) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Label) Walk(v node.Visitor) { diff --git a/node/stmt/namespace.go b/node/stmt/namespace.go index ba51331..aa42879 100644 --- a/node/stmt/namespace.go +++ b/node/stmt/namespace.go @@ -6,6 +6,7 @@ import ( type Namespace struct { name string + attributes map[string]interface{} namespaceName node.Node stmts []node.Node } @@ -13,6 +14,7 @@ type Namespace struct { func NewNamespace(namespaceName node.Node, stmts []node.Node) node.Node { return Namespace{ "Namespace", + map[string]interface{}{}, namespaceName, stmts, } @@ -23,7 +25,7 @@ func (n Namespace) Name() string { } func (n Namespace) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Namespace) Walk(v node.Visitor) { diff --git a/node/stmt/nop.go b/node/stmt/nop.go index 3b5fd6d..a65a08e 100644 --- a/node/stmt/nop.go +++ b/node/stmt/nop.go @@ -5,12 +5,14 @@ import ( ) type Nop struct { - name string + name string + attributes map[string]interface{} } func NewNop() node.Node { return Nop{ "Nop", + map[string]interface{}{}, } } @@ -19,7 +21,7 @@ func (n Nop) Name() string { } func (n Nop) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Nop) Walk(v node.Visitor) { diff --git a/node/stmt/property.go b/node/stmt/property.go index 9536261..b7c8b8d 100644 --- a/node/stmt/property.go +++ b/node/stmt/property.go @@ -5,14 +5,16 @@ import ( ) type Property struct { - name string - variable node.Node - expr node.Node + name string + attributes map[string]interface{} + variable node.Node + expr node.Node } func NewProperty(variable node.Node, expr node.Node) node.Node { return Property{ "Property", + map[string]interface{}{}, variable, expr, } @@ -22,7 +24,7 @@ func (n Property) Name() string { } func (n Property) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Property) Walk(v node.Visitor) { diff --git a/node/stmt/property_list.go b/node/stmt/property_list.go index d925127..9f48fa6 100644 --- a/node/stmt/property_list.go +++ b/node/stmt/property_list.go @@ -6,6 +6,7 @@ import ( type PropertyList struct { name string + attributes map[string]interface{} modifiers []node.Node properties []node.Node } @@ -13,6 +14,7 @@ type PropertyList struct { func NewPropertyList(modifiers []node.Node, properties []node.Node) node.Node { return PropertyList{ "PropertyList", + map[string]interface{}{}, modifiers, properties, } @@ -23,7 +25,7 @@ func (n PropertyList) Name() string { } func (n PropertyList) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n PropertyList) Walk(v node.Visitor) { diff --git a/node/stmt/return.go b/node/stmt/return.go index ef27682..0625128 100644 --- a/node/stmt/return.go +++ b/node/stmt/return.go @@ -5,13 +5,15 @@ import ( ) type Return struct { - name string - expr node.Node + name string + attributes map[string]interface{} + expr node.Node } func NewReturn(expr node.Node) node.Node { return Return{ "Return", + map[string]interface{}{}, expr, } } @@ -21,7 +23,7 @@ func (n Return) Name() string { } func (n Return) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Return) Walk(v node.Visitor) { diff --git a/node/stmt/static.go b/node/stmt/static.go index ca5611b..3f11bca 100644 --- a/node/stmt/static.go +++ b/node/stmt/static.go @@ -5,13 +5,15 @@ import ( ) type Static struct { - name string - vars []node.Node + name string + attributes map[string]interface{} + vars []node.Node } func NewStatic(vars []node.Node) node.Node { return Static{ "Static", + map[string]interface{}{}, vars, } } @@ -21,7 +23,7 @@ func (n Static) Name() string { } func (n Static) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Static) Walk(v node.Visitor) { diff --git a/node/stmt/static_var.go b/node/stmt/static_var.go index bb6b5eb..0257b21 100644 --- a/node/stmt/static_var.go +++ b/node/stmt/static_var.go @@ -5,14 +5,16 @@ import ( ) type StaticVar struct { - name string - variable node.Node - expr node.Node + name string + attributes map[string]interface{} + variable node.Node + expr node.Node } func NewStaticVar(variable node.Node, expr node.Node) node.Node { return StaticVar{ "StaticVar", + map[string]interface{}{}, variable, expr, } @@ -23,7 +25,7 @@ func (n StaticVar) Name() string { } func (n StaticVar) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n StaticVar) Walk(v node.Visitor) { diff --git a/node/stmt/stmt_list.go b/node/stmt/stmt_list.go index e8cdd33..567c438 100644 --- a/node/stmt/stmt_list.go +++ b/node/stmt/stmt_list.go @@ -5,13 +5,15 @@ import ( ) type StmtList struct { - name string - stmts []node.Node + name string + attributes map[string]interface{} + stmts []node.Node } func NewStmtList(stmts []node.Node) node.Node { return StmtList{ "StmtList", + map[string]interface{}{}, stmts, } } @@ -21,7 +23,7 @@ func (n StmtList) Name() string { } func (n StmtList) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n StmtList) Walk(v node.Visitor) { diff --git a/node/stmt/switch.go b/node/stmt/switch.go index 2db8d39..a4f55b7 100644 --- a/node/stmt/switch.go +++ b/node/stmt/switch.go @@ -6,7 +6,7 @@ import ( ) func (n Switch) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Switch) Name() string { @@ -14,15 +14,17 @@ func (n Switch) Name() string { } type Switch struct { - name string - token token.Token - cond node.Node - cases []node.Node + name string + attributes map[string]interface{} + token token.Token + cond node.Node + cases []node.Node } func NewSwitch(token token.Token, cond node.Node, cases []node.Node) node.Node { return Switch{ "Switch", + map[string]interface{}{}, token, cond, cases, diff --git a/node/stmt/throw.go b/node/stmt/throw.go index 37257fc..0200889 100644 --- a/node/stmt/throw.go +++ b/node/stmt/throw.go @@ -5,13 +5,15 @@ import ( ) type Throw struct { - name string - expr node.Node + name string + attributes map[string]interface{} + expr node.Node } func NewThrow(expr node.Node) node.Node { return Throw{ "Throw", + map[string]interface{}{}, expr, } } @@ -21,7 +23,7 @@ func (n Throw) Name() string { } func (n Throw) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Throw) Walk(v node.Visitor) { diff --git a/node/stmt/trait.go b/node/stmt/trait.go index 4a4330e..ec6cb88 100644 --- a/node/stmt/trait.go +++ b/node/stmt/trait.go @@ -5,14 +5,16 @@ import ( ) type Trait struct { - name string - traitName node.Node - stmts []node.Node + name string + attributes map[string]interface{} + traitName node.Node + stmts []node.Node } func NewTrait(traitName node.Node, stmts []node.Node) node.Node { return Trait{ "Trait", + map[string]interface{}{}, traitName, stmts, } @@ -23,7 +25,7 @@ func (n Trait) Name() string { } func (n Trait) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Trait) Walk(v node.Visitor) { diff --git a/node/stmt/trait_method_ref.go b/node/stmt/trait_method_ref.go index 66ffafc..048eccb 100644 --- a/node/stmt/trait_method_ref.go +++ b/node/stmt/trait_method_ref.go @@ -5,14 +5,16 @@ import ( ) type TraitMethodRef struct { - name string - trait node.Node - method node.Node + name string + attributes map[string]interface{} + trait node.Node + method node.Node } func NewTraitMethodRef(trait node.Node, method node.Node) node.Node { return TraitMethodRef{ "TraitMethodRef", + map[string]interface{}{}, trait, method, } @@ -23,7 +25,7 @@ func (n TraitMethodRef) Name() string { } func (n TraitMethodRef) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n TraitMethodRef) Walk(v node.Visitor) { diff --git a/node/stmt/trait_use.go b/node/stmt/trait_use.go index 33ac0bb..a95e7e8 100644 --- a/node/stmt/trait_use.go +++ b/node/stmt/trait_use.go @@ -6,6 +6,7 @@ import ( type TraitUse struct { name string + attributes map[string]interface{} traits []node.Node adaptations []node.Node } @@ -13,6 +14,7 @@ type TraitUse struct { func NewTraitUse(traits []node.Node, adaptations []node.Node) node.Node { return TraitUse{ "TraitUse", + map[string]interface{}{}, traits, adaptations, } @@ -23,7 +25,7 @@ func (n TraitUse) Name() string { } func (n TraitUse) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n TraitUse) Walk(v node.Visitor) { diff --git a/node/stmt/trait_use_alias.go b/node/stmt/trait_use_alias.go index cb3dbaa..884699f 100644 --- a/node/stmt/trait_use_alias.go +++ b/node/stmt/trait_use_alias.go @@ -5,15 +5,17 @@ import ( ) type TraitUseAlias struct { - name string - ref node.Node - modifier node.Node - alias node.Node + name string + attributes map[string]interface{} + ref node.Node + modifier node.Node + alias node.Node } func NewTraitUseAlias(ref node.Node, modifier node.Node, alias node.Node) node.Node { return TraitUseAlias{ "TraitUseAlias", + map[string]interface{}{}, ref, modifier, alias, @@ -25,7 +27,7 @@ func (n TraitUseAlias) Name() string { } func (n TraitUseAlias) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n TraitUseAlias) Walk(v node.Visitor) { diff --git a/node/stmt/trait_use_precedence.go b/node/stmt/trait_use_precedence.go index 98853b6..cf389c3 100644 --- a/node/stmt/trait_use_precedence.go +++ b/node/stmt/trait_use_precedence.go @@ -5,14 +5,16 @@ import ( ) type TraitUsePrecedence struct { - name string - ref node.Node - insteadof node.Node + name string + attributes map[string]interface{} + ref node.Node + insteadof node.Node } func NewTraitUsePrecedence(ref node.Node, insteadof node.Node) node.Node { return TraitUsePrecedence{ "TraitUsePrecedence", + map[string]interface{}{}, ref, insteadof, } @@ -23,7 +25,7 @@ func (n TraitUsePrecedence) Name() string { } func (n TraitUsePrecedence) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n TraitUsePrecedence) Walk(v node.Visitor) { diff --git a/node/stmt/try.go b/node/stmt/try.go index d37681f..5626fa6 100644 --- a/node/stmt/try.go +++ b/node/stmt/try.go @@ -5,15 +5,17 @@ import ( ) type Try struct { - name string - stmts []node.Node - catches []node.Node - finally node.Node + name string + attributes map[string]interface{} + stmts []node.Node + catches []node.Node + finally node.Node } func NewTry(stmts []node.Node, catches []node.Node, finally node.Node) node.Node { return Try{ "Try", + map[string]interface{}{}, stmts, catches, finally, @@ -25,7 +27,7 @@ func (n Try) Name() string { } func (n Try) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Try) Walk(v node.Visitor) { diff --git a/node/stmt/unset.go b/node/stmt/unset.go index 828e3b3..e28ec67 100644 --- a/node/stmt/unset.go +++ b/node/stmt/unset.go @@ -5,13 +5,15 @@ import ( ) type Unset struct { - name string - vars []node.Node + name string + attributes map[string]interface{} + vars []node.Node } func NewUnset(vars []node.Node) node.Node { return Unset{ "Unset", + map[string]interface{}{}, vars, } } @@ -21,7 +23,7 @@ func (n Unset) Name() string { } func (n Unset) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Unset) Walk(v node.Visitor) { diff --git a/node/stmt/use.go b/node/stmt/use.go index 7af6add..14c4246 100644 --- a/node/stmt/use.go +++ b/node/stmt/use.go @@ -5,15 +5,17 @@ import ( ) type Use struct { - name string - useType node.Node - use node.Node - alias node.Node + name string + attributes map[string]interface{} + useType node.Node + use node.Node + alias node.Node } func NewUse(useType node.Node, use node.Node, alias node.Node) node.Node { return Use{ "Use", + map[string]interface{}{}, useType, use, alias, @@ -25,7 +27,7 @@ func (n Use) Name() string { } func (n Use) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n Use) SetUseType(useType node.Node) node.Node { diff --git a/node/stmt/use_list.go b/node/stmt/use_list.go index 09fd00e..a28fda0 100644 --- a/node/stmt/use_list.go +++ b/node/stmt/use_list.go @@ -5,14 +5,16 @@ import ( ) type UseList struct { - name string - useType node.Node - uses []node.Node + name string + attributes map[string]interface{} + useType node.Node + uses []node.Node } func NewUseList(useType node.Node, uses []node.Node) node.Node { return UseList{ "UseList", + map[string]interface{}{}, useType, uses, } @@ -23,7 +25,7 @@ func (n UseList) Name() string { } func (n UseList) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n UseList) Walk(v node.Visitor) { diff --git a/node/stmt/while.go b/node/stmt/while.go index 3d7d62d..27fc899 100644 --- a/node/stmt/while.go +++ b/node/stmt/while.go @@ -6,15 +6,17 @@ import ( ) type While struct { - name string - token token.Token - cond node.Node - stmt node.Node + name string + attributes map[string]interface{} + token token.Token + cond node.Node + stmt node.Node } func NewWhile(token token.Token, cond node.Node, stmt node.Node) node.Node { return While{ "While", + map[string]interface{}{}, token, cond, stmt, @@ -26,7 +28,7 @@ func (n While) Name() string { } func (n While) Attributes() map[string]interface{} { - return nil + return n.attributes } func (n While) Walk(v node.Visitor) {