diff --git a/node/argument.go b/node/argument.go index 1913cb3..ab2d6a8 100644 --- a/node/argument.go +++ b/node/argument.go @@ -32,8 +32,9 @@ func (n Argument) Attribute(key string) interface{} { return n.attributes[key] } -func (n Argument) SetAttribute(key string, value interface{}) { +func (n Argument) SetAttribute(key string, value interface{}) Node { n.attributes[key] = value + return n } func (n Argument) Position() *Position { diff --git a/node/expr/array.go b/node/expr/array.go index 7352c1d..88a4221 100644 --- a/node/expr/array.go +++ b/node/expr/array.go @@ -7,7 +7,7 @@ import ( type Array struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position items []node.Node } @@ -32,8 +32,9 @@ func (n Array) Attribute(key string) interface{} { return n.attributes[key] } -func (n Array) SetAttribute(key string, value interface{}) { +func (n Array) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Array) Position() *node.Position { diff --git a/node/expr/array_dim_fetch.go b/node/expr/array_dim_fetch.go index 39cd7e8..7e84df9 100644 --- a/node/expr/array_dim_fetch.go +++ b/node/expr/array_dim_fetch.go @@ -7,7 +7,7 @@ import ( type ArrayDimFetch struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position variable node.Node dim node.Node } @@ -34,8 +34,9 @@ func (n ArrayDimFetch) Attribute(key string) interface{} { return n.attributes[key] } -func (n ArrayDimFetch) SetAttribute(key string, value interface{}) { +func (n ArrayDimFetch) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n ArrayDimFetch) Position() *node.Position { diff --git a/node/expr/array_item.go b/node/expr/array_item.go index 5340272..34a13e6 100644 --- a/node/expr/array_item.go +++ b/node/expr/array_item.go @@ -7,7 +7,7 @@ import ( type ArrayItem struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position key node.Node val node.Node } @@ -36,8 +36,9 @@ func (n ArrayItem) Attribute(key string) interface{} { return n.attributes[key] } -func (n ArrayItem) SetAttribute(key string, value interface{}) { +func (n ArrayItem) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n ArrayItem) Position() *node.Position { diff --git a/node/expr/assign_op/assign.go b/node/expr/assign_op/assign.go index df70f59..18b0680 100644 --- a/node/expr/assign_op/assign.go +++ b/node/expr/assign_op/assign.go @@ -32,8 +32,9 @@ func (n Assign) Attribute(key string) interface{} { return n.attributes[key] } -func (n Assign) SetAttribute(key string, value interface{}) { +func (n Assign) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Assign) Position() *node.Position { diff --git a/node/expr/assign_op/assign_ref.go b/node/expr/assign_op/assign_ref.go index a11ddcf..5be60a1 100644 --- a/node/expr/assign_op/assign_ref.go +++ b/node/expr/assign_op/assign_ref.go @@ -32,8 +32,9 @@ func (n AssignRef) Attribute(key string) interface{} { return n.attributes[key] } -func (n AssignRef) SetAttribute(key string, value interface{}) { +func (n AssignRef) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n AssignRef) Position() *node.Position { diff --git a/node/expr/assign_op/bitwise_and.go b/node/expr/assign_op/bitwise_and.go index cc2c3ec..eabcbc1 100644 --- a/node/expr/assign_op/bitwise_and.go +++ b/node/expr/assign_op/bitwise_and.go @@ -32,8 +32,9 @@ func (n BitwiseAnd) Attribute(key string) interface{} { return n.attributes[key] } -func (n BitwiseAnd) SetAttribute(key string, value interface{}) { +func (n BitwiseAnd) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n BitwiseAnd) Position() *node.Position { diff --git a/node/expr/assign_op/bitwise_or.go b/node/expr/assign_op/bitwise_or.go index 6475bef..8a85cd7 100644 --- a/node/expr/assign_op/bitwise_or.go +++ b/node/expr/assign_op/bitwise_or.go @@ -32,8 +32,9 @@ func (n BitwiseOr) Attribute(key string) interface{} { return n.attributes[key] } -func (n BitwiseOr) SetAttribute(key string, value interface{}) { +func (n BitwiseOr) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n BitwiseOr) Position() *node.Position { diff --git a/node/expr/assign_op/bitwise_xor.go b/node/expr/assign_op/bitwise_xor.go index 5f4bd7d..1277b76 100644 --- a/node/expr/assign_op/bitwise_xor.go +++ b/node/expr/assign_op/bitwise_xor.go @@ -28,8 +28,9 @@ func (n BitwiseXor) Attribute(key string) interface{} { return n.attributes[key] } -func (n BitwiseXor) SetAttribute(key string, value interface{}) { +func (n BitwiseXor) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n BitwiseXor) Position() *node.Position { diff --git a/node/expr/assign_op/concat.go b/node/expr/assign_op/concat.go index 24de663..e0c2fe5 100644 --- a/node/expr/assign_op/concat.go +++ b/node/expr/assign_op/concat.go @@ -32,8 +32,9 @@ func (n Concat) Attribute(key string) interface{} { return n.attributes[key] } -func (n Concat) SetAttribute(key string, value interface{}) { +func (n Concat) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Concat) Position() *node.Position { diff --git a/node/expr/assign_op/div.go b/node/expr/assign_op/div.go index 0d97957..bc3ad58 100644 --- a/node/expr/assign_op/div.go +++ b/node/expr/assign_op/div.go @@ -32,8 +32,9 @@ func (n Div) Attribute(key string) interface{} { return n.attributes[key] } -func (n Div) SetAttribute(key string, value interface{}) { +func (n Div) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Div) Position() *node.Position { diff --git a/node/expr/assign_op/minus.go b/node/expr/assign_op/minus.go index 4c8800a..3b909f4 100644 --- a/node/expr/assign_op/minus.go +++ b/node/expr/assign_op/minus.go @@ -32,8 +32,9 @@ func (n Minus) Attribute(key string) interface{} { return n.attributes[key] } -func (n Minus) SetAttribute(key string, value interface{}) { +func (n Minus) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Minus) Position() *node.Position { diff --git a/node/expr/assign_op/mod.go b/node/expr/assign_op/mod.go index e3bacca..b217443 100644 --- a/node/expr/assign_op/mod.go +++ b/node/expr/assign_op/mod.go @@ -32,8 +32,9 @@ func (n Mod) Attribute(key string) interface{} { return n.attributes[key] } -func (n Mod) SetAttribute(key string, value interface{}) { +func (n Mod) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Mod) Position() *node.Position { diff --git a/node/expr/assign_op/mul.go b/node/expr/assign_op/mul.go index 1289ad1..d474116 100644 --- a/node/expr/assign_op/mul.go +++ b/node/expr/assign_op/mul.go @@ -32,8 +32,9 @@ func (n Mul) Attribute(key string) interface{} { return n.attributes[key] } -func (n Mul) SetAttribute(key string, value interface{}) { +func (n Mul) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Mul) Position() *node.Position { diff --git a/node/expr/assign_op/plus.go b/node/expr/assign_op/plus.go index 127686c..0633912 100644 --- a/node/expr/assign_op/plus.go +++ b/node/expr/assign_op/plus.go @@ -32,8 +32,9 @@ func (n Plus) Attribute(key string) interface{} { return n.attributes[key] } -func (n Plus) SetAttribute(key string, value interface{}) { +func (n Plus) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Plus) Position() *node.Position { diff --git a/node/expr/assign_op/pow.go b/node/expr/assign_op/pow.go index e561ed4..70bed06 100644 --- a/node/expr/assign_op/pow.go +++ b/node/expr/assign_op/pow.go @@ -32,8 +32,9 @@ func (n Pow) Attribute(key string) interface{} { return n.attributes[key] } -func (n Pow) SetAttribute(key string, value interface{}) { +func (n Pow) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Pow) Position() *node.Position { diff --git a/node/expr/assign_op/shift_left.go b/node/expr/assign_op/shift_left.go index 1b1960a..c4e4218 100644 --- a/node/expr/assign_op/shift_left.go +++ b/node/expr/assign_op/shift_left.go @@ -32,8 +32,9 @@ func (n ShiftLeft) Attribute(key string) interface{} { return n.attributes[key] } -func (n ShiftLeft) SetAttribute(key string, value interface{}) { +func (n ShiftLeft) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n ShiftLeft) Position() *node.Position { diff --git a/node/expr/assign_op/shift_right.go b/node/expr/assign_op/shift_right.go index 79b0a51..5cea7dc 100644 --- a/node/expr/assign_op/shift_right.go +++ b/node/expr/assign_op/shift_right.go @@ -32,8 +32,9 @@ func (n ShiftRight) Attribute(key string) interface{} { return n.attributes[key] } -func (n ShiftRight) SetAttribute(key string, value interface{}) { +func (n ShiftRight) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n ShiftRight) Position() *node.Position { diff --git a/node/expr/binary_op/bitwise_and.go b/node/expr/binary_op/bitwise_and.go index 9aa6cca..97416f5 100644 --- a/node/expr/binary_op/bitwise_and.go +++ b/node/expr/binary_op/bitwise_and.go @@ -32,8 +32,9 @@ func (n BitwiseAnd) Attribute(key string) interface{} { return n.attributes[key] } -func (n BitwiseAnd) SetAttribute(key string, value interface{}) { +func (n BitwiseAnd) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n BitwiseAnd) Position() *node.Position { diff --git a/node/expr/binary_op/bitwise_or.go b/node/expr/binary_op/bitwise_or.go index 2b3fff9..7d4740f 100644 --- a/node/expr/binary_op/bitwise_or.go +++ b/node/expr/binary_op/bitwise_or.go @@ -28,8 +28,9 @@ func (n BitwiseOr) Attribute(key string) interface{} { return n.attributes[key] } -func (n BitwiseOr) SetAttribute(key string, value interface{}) { +func (n BitwiseOr) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n BitwiseOr) Position() *node.Position { diff --git a/node/expr/binary_op/bitwise_xor.go b/node/expr/binary_op/bitwise_xor.go index 93c6513..f7eb122 100644 --- a/node/expr/binary_op/bitwise_xor.go +++ b/node/expr/binary_op/bitwise_xor.go @@ -28,8 +28,9 @@ func (n BitwiseXor) Attribute(key string) interface{} { return n.attributes[key] } -func (n BitwiseXor) SetAttribute(key string, value interface{}) { +func (n BitwiseXor) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n BitwiseXor) Position() *node.Position { diff --git a/node/expr/binary_op/boolean_and.go b/node/expr/binary_op/boolean_and.go index c99eccb..5207e41 100644 --- a/node/expr/binary_op/boolean_and.go +++ b/node/expr/binary_op/boolean_and.go @@ -32,8 +32,9 @@ func (n BooleanAnd) Attribute(key string) interface{} { return n.attributes[key] } -func (n BooleanAnd) SetAttribute(key string, value interface{}) { +func (n BooleanAnd) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n BooleanAnd) Position() *node.Position { diff --git a/node/expr/binary_op/boolean_or.go b/node/expr/binary_op/boolean_or.go index f08aa75..ffee468 100644 --- a/node/expr/binary_op/boolean_or.go +++ b/node/expr/binary_op/boolean_or.go @@ -32,8 +32,9 @@ func (n BooleanOr) Attribute(key string) interface{} { return n.attributes[key] } -func (n BooleanOr) SetAttribute(key string, value interface{}) { +func (n BooleanOr) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n BooleanOr) Position() *node.Position { diff --git a/node/expr/binary_op/coalesce.go b/node/expr/binary_op/coalesce.go index d07cd60..eb04e58 100644 --- a/node/expr/binary_op/coalesce.go +++ b/node/expr/binary_op/coalesce.go @@ -32,8 +32,9 @@ func (n Coalesce) Attribute(key string) interface{} { return n.attributes[key] } -func (n Coalesce) SetAttribute(key string, value interface{}) { +func (n Coalesce) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Coalesce) Position() *node.Position { diff --git a/node/expr/binary_op/concat.go b/node/expr/binary_op/concat.go index e6012d9..ca3cbfd 100644 --- a/node/expr/binary_op/concat.go +++ b/node/expr/binary_op/concat.go @@ -32,8 +32,9 @@ func (n Concat) Attribute(key string) interface{} { return n.attributes[key] } -func (n Concat) SetAttribute(key string, value interface{}) { +func (n Concat) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Concat) Position() *node.Position { diff --git a/node/expr/binary_op/div.go b/node/expr/binary_op/div.go index e940d49..fdc946a 100644 --- a/node/expr/binary_op/div.go +++ b/node/expr/binary_op/div.go @@ -32,8 +32,9 @@ func (n Div) Attribute(key string) interface{} { return n.attributes[key] } -func (n Div) SetAttribute(key string, value interface{}) { +func (n Div) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Div) Position() *node.Position { diff --git a/node/expr/binary_op/equal.go b/node/expr/binary_op/equal.go index 654dd2a..a257a19 100644 --- a/node/expr/binary_op/equal.go +++ b/node/expr/binary_op/equal.go @@ -32,8 +32,9 @@ func (n Equal) Attribute(key string) interface{} { return n.attributes[key] } -func (n Equal) SetAttribute(key string, value interface{}) { +func (n Equal) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Equal) Position() *node.Position { diff --git a/node/expr/binary_op/greater.go b/node/expr/binary_op/greater.go index b7bb483..9052de7 100644 --- a/node/expr/binary_op/greater.go +++ b/node/expr/binary_op/greater.go @@ -32,8 +32,9 @@ func (n Greater) Attribute(key string) interface{} { return n.attributes[key] } -func (n Greater) SetAttribute(key string, value interface{}) { +func (n Greater) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Greater) Position() *node.Position { diff --git a/node/expr/binary_op/greater_or_equal.go b/node/expr/binary_op/greater_or_equal.go index a13d59b..e12ae9f 100644 --- a/node/expr/binary_op/greater_or_equal.go +++ b/node/expr/binary_op/greater_or_equal.go @@ -32,8 +32,9 @@ func (n GreaterOrEqual) Attribute(key string) interface{} { return n.attributes[key] } -func (n GreaterOrEqual) SetAttribute(key string, value interface{}) { +func (n GreaterOrEqual) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n GreaterOrEqual) Position() *node.Position { diff --git a/node/expr/binary_op/identical.go b/node/expr/binary_op/identical.go index efd5c14..2fb2466 100644 --- a/node/expr/binary_op/identical.go +++ b/node/expr/binary_op/identical.go @@ -32,8 +32,9 @@ func (n Identical) Attribute(key string) interface{} { return n.attributes[key] } -func (n Identical) SetAttribute(key string, value interface{}) { +func (n Identical) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Identical) Position() *node.Position { diff --git a/node/expr/binary_op/logical_and.go b/node/expr/binary_op/logical_and.go index 3972e92..fba141a 100644 --- a/node/expr/binary_op/logical_and.go +++ b/node/expr/binary_op/logical_and.go @@ -32,8 +32,9 @@ func (n LogicalAnd) Attribute(key string) interface{} { return n.attributes[key] } -func (n LogicalAnd) SetAttribute(key string, value interface{}) { +func (n LogicalAnd) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n LogicalAnd) Position() *node.Position { diff --git a/node/expr/binary_op/logical_or.go b/node/expr/binary_op/logical_or.go index dc22d55..60d88cd 100644 --- a/node/expr/binary_op/logical_or.go +++ b/node/expr/binary_op/logical_or.go @@ -32,8 +32,9 @@ func (n LogicalOr) Attribute(key string) interface{} { return n.attributes[key] } -func (n LogicalOr) SetAttribute(key string, value interface{}) { +func (n LogicalOr) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n LogicalOr) Position() *node.Position { diff --git a/node/expr/binary_op/logical_xor.go b/node/expr/binary_op/logical_xor.go index 47bd1de..6b54a45 100644 --- a/node/expr/binary_op/logical_xor.go +++ b/node/expr/binary_op/logical_xor.go @@ -32,8 +32,9 @@ func (n LogicalXor) Attribute(key string) interface{} { return n.attributes[key] } -func (n LogicalXor) SetAttribute(key string, value interface{}) { +func (n LogicalXor) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n LogicalXor) Position() *node.Position { diff --git a/node/expr/binary_op/minus.go b/node/expr/binary_op/minus.go index fe68838..e7865c9 100644 --- a/node/expr/binary_op/minus.go +++ b/node/expr/binary_op/minus.go @@ -32,8 +32,9 @@ func (n Minus) Attribute(key string) interface{} { return n.attributes[key] } -func (n Minus) SetAttribute(key string, value interface{}) { +func (n Minus) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Minus) Position() *node.Position { diff --git a/node/expr/binary_op/mod.go b/node/expr/binary_op/mod.go index e69f016..b5414d6 100644 --- a/node/expr/binary_op/mod.go +++ b/node/expr/binary_op/mod.go @@ -32,8 +32,9 @@ func (n Mod) Attribute(key string) interface{} { return n.attributes[key] } -func (n Mod) SetAttribute(key string, value interface{}) { +func (n Mod) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Mod) Position() *node.Position { diff --git a/node/expr/binary_op/mul.go b/node/expr/binary_op/mul.go index 2174112..14a7147 100644 --- a/node/expr/binary_op/mul.go +++ b/node/expr/binary_op/mul.go @@ -32,8 +32,9 @@ func (n Mul) Attribute(key string) interface{} { return n.attributes[key] } -func (n Mul) SetAttribute(key string, value interface{}) { +func (n Mul) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Mul) Position() *node.Position { diff --git a/node/expr/binary_op/not_equal.go b/node/expr/binary_op/not_equal.go index 34c422d..1650b12 100644 --- a/node/expr/binary_op/not_equal.go +++ b/node/expr/binary_op/not_equal.go @@ -32,8 +32,9 @@ func (n NotEqual) Attribute(key string) interface{} { return n.attributes[key] } -func (n NotEqual) SetAttribute(key string, value interface{}) { +func (n NotEqual) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n NotEqual) Position() *node.Position { diff --git a/node/expr/binary_op/not_identical.go b/node/expr/binary_op/not_identical.go index 6d8d762..df79f09 100644 --- a/node/expr/binary_op/not_identical.go +++ b/node/expr/binary_op/not_identical.go @@ -32,8 +32,9 @@ func (n NotIdentical) Attribute(key string) interface{} { return n.attributes[key] } -func (n NotIdentical) SetAttribute(key string, value interface{}) { +func (n NotIdentical) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n NotIdentical) Position() *node.Position { diff --git a/node/expr/binary_op/plus.go b/node/expr/binary_op/plus.go index e3082c7..29dcc5c 100644 --- a/node/expr/binary_op/plus.go +++ b/node/expr/binary_op/plus.go @@ -32,8 +32,9 @@ func (n Plus) Attribute(key string) interface{} { return n.attributes[key] } -func (n Plus) SetAttribute(key string, value interface{}) { +func (n Plus) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Plus) Position() *node.Position { diff --git a/node/expr/binary_op/pow.go b/node/expr/binary_op/pow.go index b7c74e8..b94a85a 100644 --- a/node/expr/binary_op/pow.go +++ b/node/expr/binary_op/pow.go @@ -32,8 +32,9 @@ func (n Pow) Attribute(key string) interface{} { return n.attributes[key] } -func (n Pow) SetAttribute(key string, value interface{}) { +func (n Pow) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Pow) Position() *node.Position { diff --git a/node/expr/binary_op/shift_left.go b/node/expr/binary_op/shift_left.go index 4d7bdfa..446acad 100644 --- a/node/expr/binary_op/shift_left.go +++ b/node/expr/binary_op/shift_left.go @@ -32,8 +32,9 @@ func (n ShiftLeft) Attribute(key string) interface{} { return n.attributes[key] } -func (n ShiftLeft) SetAttribute(key string, value interface{}) { +func (n ShiftLeft) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n ShiftLeft) Position() *node.Position { diff --git a/node/expr/binary_op/shift_right.go b/node/expr/binary_op/shift_right.go index 960bdb0..ffc2629 100644 --- a/node/expr/binary_op/shift_right.go +++ b/node/expr/binary_op/shift_right.go @@ -32,8 +32,9 @@ func (n ShiftRight) Attribute(key string) interface{} { return n.attributes[key] } -func (n ShiftRight) SetAttribute(key string, value interface{}) { +func (n ShiftRight) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n ShiftRight) Position() *node.Position { diff --git a/node/expr/binary_op/smaller.go b/node/expr/binary_op/smaller.go index 79d4160..5a93d97 100644 --- a/node/expr/binary_op/smaller.go +++ b/node/expr/binary_op/smaller.go @@ -32,8 +32,9 @@ func (n Smaller) Attribute(key string) interface{} { return n.attributes[key] } -func (n Smaller) SetAttribute(key string, value interface{}) { +func (n Smaller) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Smaller) Position() *node.Position { diff --git a/node/expr/binary_op/smaller_or_equal.go b/node/expr/binary_op/smaller_or_equal.go index 0001951..5577a89 100644 --- a/node/expr/binary_op/smaller_or_equal.go +++ b/node/expr/binary_op/smaller_or_equal.go @@ -32,8 +32,9 @@ func (n SmallerOrEqual) Attribute(key string) interface{} { return n.attributes[key] } -func (n SmallerOrEqual) SetAttribute(key string, value interface{}) { +func (n SmallerOrEqual) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n SmallerOrEqual) Position() *node.Position { diff --git a/node/expr/binary_op/spaceship.go b/node/expr/binary_op/spaceship.go index 65330fb..d6ac00a 100644 --- a/node/expr/binary_op/spaceship.go +++ b/node/expr/binary_op/spaceship.go @@ -32,8 +32,9 @@ func (n Spaceship) Attribute(key string) interface{} { return n.attributes[key] } -func (n Spaceship) SetAttribute(key string, value interface{}) { +func (n Spaceship) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Spaceship) Position() *node.Position { diff --git a/node/expr/bitwise_not.go b/node/expr/bitwise_not.go index 84ebd74..ffcce38 100644 --- a/node/expr/bitwise_not.go +++ b/node/expr/bitwise_not.go @@ -7,7 +7,7 @@ import ( type BitwiseNot struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position expr node.Node } @@ -32,8 +32,9 @@ func (n BitwiseNot) Attribute(key string) interface{} { return n.attributes[key] } -func (n BitwiseNot) SetAttribute(key string, value interface{}) { +func (n BitwiseNot) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n BitwiseNot) Position() *node.Position { diff --git a/node/expr/boolean_not.go b/node/expr/boolean_not.go index af5a749..8329040 100644 --- a/node/expr/boolean_not.go +++ b/node/expr/boolean_not.go @@ -7,7 +7,7 @@ import ( type BooleanNot struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position expr node.Node } @@ -32,8 +32,9 @@ func (n BooleanNot) Attribute(key string) interface{} { return n.attributes[key] } -func (n BooleanNot) SetAttribute(key string, value interface{}) { +func (n BooleanNot) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n BooleanNot) Position() *node.Position { diff --git a/node/expr/cast/cast_array.go b/node/expr/cast/cast_array.go index 10c21f6..3638307 100644 --- a/node/expr/cast/cast_array.go +++ b/node/expr/cast/cast_array.go @@ -31,8 +31,9 @@ func (n CastArray) Attribute(key string) interface{} { return n.attributes[key] } -func (n CastArray) SetAttribute(key string, value interface{}) { +func (n CastArray) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n CastArray) Position() *node.Position { diff --git a/node/expr/cast/cast_bool.go b/node/expr/cast/cast_bool.go index c310f2f..a2bf0c0 100644 --- a/node/expr/cast/cast_bool.go +++ b/node/expr/cast/cast_bool.go @@ -31,8 +31,9 @@ func (n CastBool) Attribute(key string) interface{} { return n.attributes[key] } -func (n CastBool) SetAttribute(key string, value interface{}) { +func (n CastBool) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n CastBool) Position() *node.Position { diff --git a/node/expr/cast/cast_double.go b/node/expr/cast/cast_double.go index c0802d9..c3a0e88 100644 --- a/node/expr/cast/cast_double.go +++ b/node/expr/cast/cast_double.go @@ -31,8 +31,9 @@ func (n CastDouble) Attribute(key string) interface{} { return n.attributes[key] } -func (n CastDouble) SetAttribute(key string, value interface{}) { +func (n CastDouble) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n CastDouble) Position() *node.Position { diff --git a/node/expr/cast/cast_int.go b/node/expr/cast/cast_int.go index 9bce42b..3cc4b1b 100644 --- a/node/expr/cast/cast_int.go +++ b/node/expr/cast/cast_int.go @@ -31,8 +31,9 @@ func (n CastInt) Attribute(key string) interface{} { return n.attributes[key] } -func (n CastInt) SetAttribute(key string, value interface{}) { +func (n CastInt) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n CastInt) Position() *node.Position { diff --git a/node/expr/cast/cast_object.go b/node/expr/cast/cast_object.go index 9d12489..f8af5cf 100644 --- a/node/expr/cast/cast_object.go +++ b/node/expr/cast/cast_object.go @@ -31,8 +31,9 @@ func (n CastObject) Attribute(key string) interface{} { return n.attributes[key] } -func (n CastObject) SetAttribute(key string, value interface{}) { +func (n CastObject) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n CastObject) Position() *node.Position { diff --git a/node/expr/cast/cast_string.go b/node/expr/cast/cast_string.go index a42959a..db02f5b 100644 --- a/node/expr/cast/cast_string.go +++ b/node/expr/cast/cast_string.go @@ -31,8 +31,9 @@ func (n CastString) Attribute(key string) interface{} { return n.attributes[key] } -func (n CastString) SetAttribute(key string, value interface{}) { +func (n CastString) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n CastString) Position() *node.Position { diff --git a/node/expr/cast/cast_unset.go b/node/expr/cast/cast_unset.go index 9b7d551..1baa099 100644 --- a/node/expr/cast/cast_unset.go +++ b/node/expr/cast/cast_unset.go @@ -31,8 +31,9 @@ func (n CastUnset) Attribute(key string) interface{} { return n.attributes[key] } -func (n CastUnset) SetAttribute(key string, value interface{}) { +func (n CastUnset) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n CastUnset) Position() *node.Position { diff --git a/node/expr/class_const_fetch.go b/node/expr/class_const_fetch.go index f392d02..516bf6d 100644 --- a/node/expr/class_const_fetch.go +++ b/node/expr/class_const_fetch.go @@ -34,8 +34,9 @@ func (n ClassConstFetch) Attribute(key string) interface{} { return n.attributes[key] } -func (n ClassConstFetch) SetAttribute(key string, value interface{}) { +func (n ClassConstFetch) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n ClassConstFetch) Position() *node.Position { diff --git a/node/expr/clone.go b/node/expr/clone.go index 394fb1d..8f8a14c 100644 --- a/node/expr/clone.go +++ b/node/expr/clone.go @@ -7,7 +7,7 @@ import ( type Clone struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position expr node.Node } @@ -32,8 +32,9 @@ func (n Clone) Attribute(key string) interface{} { return n.attributes[key] } -func (n Clone) SetAttribute(key string, value interface{}) { +func (n Clone) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Clone) Position() *node.Position { diff --git a/node/expr/closure.go b/node/expr/closure.go index 7fd6e7c..4a9bcef 100644 --- a/node/expr/closure.go +++ b/node/expr/closure.go @@ -42,8 +42,9 @@ func (n Closure) Attribute(key string) interface{} { return n.attributes[key] } -func (n Closure) SetAttribute(key string, value interface{}) { +func (n Closure) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Closure) Position() *node.Position { diff --git a/node/expr/closure_use.go b/node/expr/closure_use.go index 40b9b13..71ae58e 100644 --- a/node/expr/closure_use.go +++ b/node/expr/closure_use.go @@ -7,7 +7,7 @@ import ( type ClusureUse struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position variable node.Node } @@ -34,8 +34,9 @@ func (n ClusureUse) Attribute(key string) interface{} { return n.attributes[key] } -func (n ClusureUse) SetAttribute(key string, value interface{}) { +func (n ClusureUse) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n ClusureUse) Position() *node.Position { diff --git a/node/expr/const_fetch.go b/node/expr/const_fetch.go index a34c587..42df3d0 100644 --- a/node/expr/const_fetch.go +++ b/node/expr/const_fetch.go @@ -7,7 +7,7 @@ import ( type ConstFetch struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position constant node.Node } @@ -32,8 +32,9 @@ func (n ConstFetch) Attribute(key string) interface{} { return n.attributes[key] } -func (n ConstFetch) SetAttribute(key string, value interface{}) { +func (n ConstFetch) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n ConstFetch) Position() *node.Position { diff --git a/node/expr/empty.go b/node/expr/empty.go index a72d4cd..e5f3346 100644 --- a/node/expr/empty.go +++ b/node/expr/empty.go @@ -7,7 +7,7 @@ import ( type Empty struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position expr node.Node } @@ -32,8 +32,9 @@ func (n Empty) Attribute(key string) interface{} { return n.attributes[key] } -func (n Empty) SetAttribute(key string, value interface{}) { +func (n Empty) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Empty) Position() *node.Position { diff --git a/node/expr/error_suppress.go b/node/expr/error_suppress.go index 02fae96..30b6685 100644 --- a/node/expr/error_suppress.go +++ b/node/expr/error_suppress.go @@ -7,7 +7,7 @@ import ( type ErrorSuppress struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position expr node.Node } @@ -32,8 +32,9 @@ func (n ErrorSuppress) Attribute(key string) interface{} { return n.attributes[key] } -func (n ErrorSuppress) SetAttribute(key string, value interface{}) { +func (n ErrorSuppress) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n ErrorSuppress) Position() *node.Position { diff --git a/node/expr/eval.go b/node/expr/eval.go index 9554aa9..97e34ff 100644 --- a/node/expr/eval.go +++ b/node/expr/eval.go @@ -7,7 +7,7 @@ import ( type Eval struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position expr node.Node } @@ -32,8 +32,9 @@ func (n Eval) Attribute(key string) interface{} { return n.attributes[key] } -func (n Eval) SetAttribute(key string, value interface{}) { +func (n Eval) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Eval) Position() *node.Position { diff --git a/node/expr/exit.go b/node/expr/exit.go index d9bb659..da1052d 100644 --- a/node/expr/exit.go +++ b/node/expr/exit.go @@ -7,7 +7,7 @@ import ( type Exit struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position expr node.Node } @@ -34,8 +34,9 @@ func (n Exit) Attribute(key string) interface{} { return n.attributes[key] } -func (n Exit) SetAttribute(key string, value interface{}) { +func (n Exit) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Exit) Position() *node.Position { diff --git a/node/expr/function_call.go b/node/expr/function_call.go index 468132f..0e3db07 100644 --- a/node/expr/function_call.go +++ b/node/expr/function_call.go @@ -7,7 +7,7 @@ import ( type FunctionCall struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position function node.Node arguments []node.Node } @@ -34,8 +34,9 @@ func (n FunctionCall) Attribute(key string) interface{} { return n.attributes[key] } -func (n FunctionCall) SetAttribute(key string, value interface{}) { +func (n FunctionCall) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n FunctionCall) Position() *node.Position { diff --git a/node/expr/include.go b/node/expr/include.go index b1ea766..dc247f5 100644 --- a/node/expr/include.go +++ b/node/expr/include.go @@ -7,7 +7,7 @@ import ( type Include struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position expr node.Node } @@ -32,8 +32,9 @@ func (n Include) Attribute(key string) interface{} { return n.attributes[key] } -func (n Include) SetAttribute(key string, value interface{}) { +func (n Include) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Include) Position() *node.Position { diff --git a/node/expr/include_once.go b/node/expr/include_once.go index dc08dd1..3c45aa9 100644 --- a/node/expr/include_once.go +++ b/node/expr/include_once.go @@ -7,7 +7,7 @@ import ( type IncludeOnce struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position expr node.Node } @@ -32,8 +32,9 @@ func (n IncludeOnce) Attribute(key string) interface{} { return n.attributes[key] } -func (n IncludeOnce) SetAttribute(key string, value interface{}) { +func (n IncludeOnce) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n IncludeOnce) Position() *node.Position { diff --git a/node/expr/instance_of.go b/node/expr/instance_of.go index 5d557ca..ecb3ebe 100644 --- a/node/expr/instance_of.go +++ b/node/expr/instance_of.go @@ -7,7 +7,7 @@ import ( type InstanceOf struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position expr node.Node class node.Node } @@ -34,8 +34,9 @@ func (n InstanceOf) Attribute(key string) interface{} { return n.attributes[key] } -func (n InstanceOf) SetAttribute(key string, value interface{}) { +func (n InstanceOf) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n InstanceOf) Position() *node.Position { diff --git a/node/expr/isset.go b/node/expr/isset.go index 9c8c607..43fe7d9 100644 --- a/node/expr/isset.go +++ b/node/expr/isset.go @@ -7,7 +7,7 @@ import ( type Isset struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position variables []node.Node } @@ -32,8 +32,9 @@ func (n Isset) Attribute(key string) interface{} { return n.attributes[key] } -func (n Isset) SetAttribute(key string, value interface{}) { +func (n Isset) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Isset) Position() *node.Position { diff --git a/node/expr/list.go b/node/expr/list.go index 3e956f7..5c613d3 100644 --- a/node/expr/list.go +++ b/node/expr/list.go @@ -7,7 +7,7 @@ import ( type List struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position items []node.Node } @@ -32,8 +32,9 @@ func (n List) Attribute(key string) interface{} { return n.attributes[key] } -func (n List) SetAttribute(key string, value interface{}) { +func (n List) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n List) Position() *node.Position { diff --git a/node/expr/method_call.go b/node/expr/method_call.go index e140f3b..ab73231 100644 --- a/node/expr/method_call.go +++ b/node/expr/method_call.go @@ -7,7 +7,7 @@ import ( type MethodCall struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position variable node.Node method node.Node arguments []node.Node @@ -36,8 +36,9 @@ func (n MethodCall) Attribute(key string) interface{} { return n.attributes[key] } -func (n MethodCall) SetAttribute(key string, value interface{}) { +func (n MethodCall) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n MethodCall) Position() *node.Position { diff --git a/node/expr/new.go b/node/expr/new.go index aaafe53..b2800e4 100644 --- a/node/expr/new.go +++ b/node/expr/new.go @@ -7,7 +7,7 @@ import ( type New struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position class node.Node arguments []node.Node } @@ -34,8 +34,9 @@ func (n New) Attribute(key string) interface{} { return n.attributes[key] } -func (n New) SetAttribute(key string, value interface{}) { +func (n New) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n New) Position() *node.Position { diff --git a/node/expr/post_dec.go b/node/expr/post_dec.go index 23f0257..d3e55bc 100644 --- a/node/expr/post_dec.go +++ b/node/expr/post_dec.go @@ -7,7 +7,7 @@ import ( type PostDec struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position variable node.Node } @@ -32,8 +32,9 @@ func (n PostDec) Attribute(key string) interface{} { return n.attributes[key] } -func (n PostDec) SetAttribute(key string, value interface{}) { +func (n PostDec) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n PostDec) Position() *node.Position { diff --git a/node/expr/post_inc.go b/node/expr/post_inc.go index c27d72e..7e9ee78 100644 --- a/node/expr/post_inc.go +++ b/node/expr/post_inc.go @@ -7,7 +7,7 @@ import ( type PostInc struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position variable node.Node } @@ -32,8 +32,9 @@ func (n PostInc) Attribute(key string) interface{} { return n.attributes[key] } -func (n PostInc) SetAttribute(key string, value interface{}) { +func (n PostInc) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n PostInc) Position() *node.Position { diff --git a/node/expr/pre_dec.go b/node/expr/pre_dec.go index adcf9ac..4e0b255 100644 --- a/node/expr/pre_dec.go +++ b/node/expr/pre_dec.go @@ -7,7 +7,7 @@ import ( type PreDec struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position variable node.Node } @@ -32,8 +32,9 @@ func (n PreDec) Attribute(key string) interface{} { return n.attributes[key] } -func (n PreDec) SetAttribute(key string, value interface{}) { +func (n PreDec) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n PreDec) Position() *node.Position { diff --git a/node/expr/pre_inc.go b/node/expr/pre_inc.go index c18936b..0f06e0e 100644 --- a/node/expr/pre_inc.go +++ b/node/expr/pre_inc.go @@ -7,7 +7,7 @@ import ( type PreInc struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position variable node.Node } @@ -32,8 +32,9 @@ func (n PreInc) Attribute(key string) interface{} { return n.attributes[key] } -func (n PreInc) SetAttribute(key string, value interface{}) { +func (n PreInc) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n PreInc) Position() *node.Position { diff --git a/node/expr/print.go b/node/expr/print.go index 9e1276a..2fa2f45 100644 --- a/node/expr/print.go +++ b/node/expr/print.go @@ -7,7 +7,7 @@ import ( type Print struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position expr node.Node } @@ -32,8 +32,9 @@ func (n Print) Attribute(key string) interface{} { return n.attributes[key] } -func (n Print) SetAttribute(key string, value interface{}) { +func (n Print) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Print) Position() *node.Position { diff --git a/node/expr/property_fetch.go b/node/expr/property_fetch.go index 07b370c..6a651a5 100644 --- a/node/expr/property_fetch.go +++ b/node/expr/property_fetch.go @@ -7,7 +7,7 @@ import ( type PropertyFetch struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position variable node.Node property node.Node } @@ -34,8 +34,9 @@ func (n PropertyFetch) Attribute(key string) interface{} { return n.attributes[key] } -func (n PropertyFetch) SetAttribute(key string, value interface{}) { +func (n PropertyFetch) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n PropertyFetch) Position() *node.Position { diff --git a/node/expr/require.go b/node/expr/require.go index 8033f6c..9c5cbde 100644 --- a/node/expr/require.go +++ b/node/expr/require.go @@ -7,7 +7,7 @@ import ( type Require struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position expr node.Node } @@ -32,8 +32,9 @@ func (n Require) Attribute(key string) interface{} { return n.attributes[key] } -func (n Require) SetAttribute(key string, value interface{}) { +func (n Require) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Require) Position() *node.Position { diff --git a/node/expr/require_once.go b/node/expr/require_once.go index 18ba761..b62562a 100644 --- a/node/expr/require_once.go +++ b/node/expr/require_once.go @@ -7,7 +7,7 @@ import ( type RequireOnce struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position expr node.Node } @@ -32,8 +32,9 @@ func (n RequireOnce) Attribute(key string) interface{} { return n.attributes[key] } -func (n RequireOnce) SetAttribute(key string, value interface{}) { +func (n RequireOnce) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n RequireOnce) Position() *node.Position { diff --git a/node/expr/shell_exec.go b/node/expr/shell_exec.go index f17679b..56892b5 100644 --- a/node/expr/shell_exec.go +++ b/node/expr/shell_exec.go @@ -7,7 +7,7 @@ import ( type ShellExec struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position parts []node.Node } @@ -32,8 +32,9 @@ func (n ShellExec) Attribute(key string) interface{} { return n.attributes[key] } -func (n ShellExec) SetAttribute(key string, value interface{}) { +func (n ShellExec) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n ShellExec) Position() *node.Position { diff --git a/node/expr/short_array.go b/node/expr/short_array.go index f764493..b4f1cff 100644 --- a/node/expr/short_array.go +++ b/node/expr/short_array.go @@ -7,7 +7,7 @@ import ( type ShortArray struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position items []node.Node } @@ -32,8 +32,9 @@ func (n ShortArray) Attribute(key string) interface{} { return n.attributes[key] } -func (n ShortArray) SetAttribute(key string, value interface{}) { +func (n ShortArray) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n ShortArray) Position() *node.Position { diff --git a/node/expr/short_list.go b/node/expr/short_list.go index 983cf9c..7c321b9 100644 --- a/node/expr/short_list.go +++ b/node/expr/short_list.go @@ -7,7 +7,7 @@ import ( type ShortList struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position items []node.Node } @@ -32,8 +32,9 @@ func (n ShortList) Attribute(key string) interface{} { return n.attributes[key] } -func (n ShortList) SetAttribute(key string, value interface{}) { +func (n ShortList) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n ShortList) Position() *node.Position { diff --git a/node/expr/static_call.go b/node/expr/static_call.go index ea0a598..8585db4 100644 --- a/node/expr/static_call.go +++ b/node/expr/static_call.go @@ -7,7 +7,7 @@ import ( type StaticCall struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position class node.Node call node.Node arguments []node.Node @@ -36,8 +36,9 @@ func (n StaticCall) Attribute(key string) interface{} { return n.attributes[key] } -func (n StaticCall) SetAttribute(key string, value interface{}) { +func (n StaticCall) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n StaticCall) Position() *node.Position { diff --git a/node/expr/static_property_fetch.go b/node/expr/static_property_fetch.go index 369faa9..bf9f386 100644 --- a/node/expr/static_property_fetch.go +++ b/node/expr/static_property_fetch.go @@ -7,7 +7,7 @@ import ( type StaticPropertyFetch struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position class node.Node property node.Node } @@ -34,8 +34,9 @@ func (n StaticPropertyFetch) Attribute(key string) interface{} { return n.attributes[key] } -func (n StaticPropertyFetch) SetAttribute(key string, value interface{}) { +func (n StaticPropertyFetch) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n StaticPropertyFetch) Position() *node.Position { diff --git a/node/expr/ternary.go b/node/expr/ternary.go index 690212f..a924a25 100644 --- a/node/expr/ternary.go +++ b/node/expr/ternary.go @@ -7,7 +7,7 @@ import ( type Ternary struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position condition node.Node ifTrue node.Node ifFalse node.Node @@ -36,8 +36,9 @@ func (n Ternary) Attribute(key string) interface{} { return n.attributes[key] } -func (n Ternary) SetAttribute(key string, value interface{}) { +func (n Ternary) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Ternary) Position() *node.Position { diff --git a/node/expr/unary_minus.go b/node/expr/unary_minus.go index da4b312..708eacf 100644 --- a/node/expr/unary_minus.go +++ b/node/expr/unary_minus.go @@ -7,7 +7,7 @@ import ( type UnaryMinus struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position expr node.Node } @@ -32,8 +32,9 @@ func (n UnaryMinus) Attribute(key string) interface{} { return n.attributes[key] } -func (n UnaryMinus) SetAttribute(key string, value interface{}) { +func (n UnaryMinus) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n UnaryMinus) Position() *node.Position { diff --git a/node/expr/unary_plus.go b/node/expr/unary_plus.go index 65d2060..5b1b482 100644 --- a/node/expr/unary_plus.go +++ b/node/expr/unary_plus.go @@ -7,7 +7,7 @@ import ( type UnaryPlus struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position expr node.Node } @@ -32,8 +32,9 @@ func (n UnaryPlus) Attribute(key string) interface{} { return n.attributes[key] } -func (n UnaryPlus) SetAttribute(key string, value interface{}) { +func (n UnaryPlus) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n UnaryPlus) Position() *node.Position { diff --git a/node/expr/variable.go b/node/expr/variable.go index 4bc192c..7632a3b 100644 --- a/node/expr/variable.go +++ b/node/expr/variable.go @@ -7,7 +7,7 @@ import ( type Variable struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position varName node.Node } @@ -32,8 +32,9 @@ func (n Variable) Attribute(key string) interface{} { return n.attributes[key] } -func (n Variable) SetAttribute(key string, value interface{}) { +func (n Variable) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Variable) Position() *node.Position { diff --git a/node/expr/yield.go b/node/expr/yield.go index 6a25d0c..2e792a7 100644 --- a/node/expr/yield.go +++ b/node/expr/yield.go @@ -7,7 +7,7 @@ import ( type Yield struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position key node.Node value node.Node } @@ -34,8 +34,9 @@ func (n Yield) Attribute(key string) interface{} { return n.attributes[key] } -func (n Yield) SetAttribute(key string, value interface{}) { +func (n Yield) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Yield) Position() *node.Position { diff --git a/node/expr/yield_from.go b/node/expr/yield_from.go index c548414..590e467 100644 --- a/node/expr/yield_from.go +++ b/node/expr/yield_from.go @@ -7,7 +7,7 @@ import ( type YieldFrom struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position expr node.Node } @@ -32,8 +32,9 @@ func (n YieldFrom) Attribute(key string) interface{} { return n.attributes[key] } -func (n YieldFrom) SetAttribute(key string, value interface{}) { +func (n YieldFrom) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n YieldFrom) Position() *node.Position { diff --git a/node/identifier.go b/node/identifier.go index b1cedd0..79a0b31 100644 --- a/node/identifier.go +++ b/node/identifier.go @@ -32,8 +32,9 @@ func (n Identifier) Attribute(key string) interface{} { return n.attributes[key] } -func (n Identifier) SetAttribute(key string, value interface{}) { +func (n Identifier) SetAttribute(key string, value interface{}) Node { n.attributes[key] = value + return n } func (n Identifier) Position() *Position { diff --git a/node/name/name.go b/node/name/name.go index 4d81a0b..59944c7 100644 --- a/node/name/name.go +++ b/node/name/name.go @@ -7,7 +7,7 @@ import ( type NameNode struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position parts []node.Node } @@ -32,8 +32,9 @@ func (n NameNode) Attribute(key string) interface{} { return n.attributes[key] } -func (n NameNode) SetAttribute(key string, value interface{}) { +func (n NameNode) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n NameNode) Position() *node.Position { diff --git a/node/name/name_part.go b/node/name/name_part.go index 5494a16..b56e3f3 100644 --- a/node/name/name_part.go +++ b/node/name/name_part.go @@ -7,7 +7,7 @@ import ( type NamePart struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position } func NewNamePart(value string) node.Node { @@ -32,8 +32,9 @@ func (n NamePart) Attribute(key string) interface{} { return n.attributes[key] } -func (n NamePart) SetAttribute(key string, value interface{}) { +func (n NamePart) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n NamePart) Position() *node.Position { diff --git a/node/node.go b/node/node.go index 1d75309..6130ebe 100644 --- a/node/node.go +++ b/node/node.go @@ -10,7 +10,7 @@ type Node interface { type Attributer interface { Attributes() map[string]interface{} Attribute(key string) interface{} - SetAttribute(key string, value interface{}) + SetAttribute(key string, value interface{}) Node } type Positioner interface { diff --git a/node/nullable.go b/node/nullable.go index f0fe2e6..93f525d 100644 --- a/node/nullable.go +++ b/node/nullable.go @@ -28,8 +28,9 @@ func (n Nullable) Attribute(key string) interface{} { return n.attributes[key] } -func (n Nullable) SetAttribute(key string, value interface{}) { +func (n Nullable) SetAttribute(key string, value interface{}) Node { n.attributes[key] = value + return n } func (n Nullable) Position() *Position { diff --git a/node/parameter.go b/node/parameter.go index 8d313e8..40fa20c 100644 --- a/node/parameter.go +++ b/node/parameter.go @@ -35,8 +35,9 @@ func (n Parameter) Attribute(key string) interface{} { return n.attributes[key] } -func (n Parameter) SetAttribute(key string, value interface{}) { +func (n Parameter) SetAttribute(key string, value interface{}) Node { n.attributes[key] = value + return n } func (n Parameter) Position() *Position { diff --git a/node/scalar/dnumber.go b/node/scalar/dnumber.go index e5b4a68..adf5ed5 100644 --- a/node/scalar/dnumber.go +++ b/node/scalar/dnumber.go @@ -7,7 +7,7 @@ import ( type Dnumber struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position } func NewDnumber(value string) node.Node { @@ -32,8 +32,9 @@ func (n Dnumber) Attribute(key string) interface{} { return n.attributes[key] } -func (n Dnumber) SetAttribute(key string, value interface{}) { +func (n Dnumber) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Dnumber) Position() *node.Position { diff --git a/node/scalar/encapsed.go b/node/scalar/encapsed.go index 1de9992..d65df9e 100644 --- a/node/scalar/encapsed.go +++ b/node/scalar/encapsed.go @@ -32,8 +32,9 @@ func (n Encapsed) Attribute(key string) interface{} { return n.attributes[key] } -func (n Encapsed) SetAttribute(key string, value interface{}) { +func (n Encapsed) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Encapsed) Position() *node.Position { diff --git a/node/scalar/encapsed_string_part.go b/node/scalar/encapsed_string_part.go index 370f3dd..fc2fc2f 100644 --- a/node/scalar/encapsed_string_part.go +++ b/node/scalar/encapsed_string_part.go @@ -7,7 +7,7 @@ import ( type EncapsedStringPart struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position } func NewEncapsedStringPart(value string) node.Node { @@ -32,8 +32,9 @@ func (n EncapsedStringPart) Attribute(key string) interface{} { return n.attributes[key] } -func (n EncapsedStringPart) SetAttribute(key string, value interface{}) { +func (n EncapsedStringPart) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n EncapsedStringPart) Position() *node.Position { diff --git a/node/scalar/lnumber.go b/node/scalar/lnumber.go index 7a60ef4..7358c24 100644 --- a/node/scalar/lnumber.go +++ b/node/scalar/lnumber.go @@ -7,7 +7,7 @@ import ( type Lnumber struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position } func NewLnumber(value string) node.Node { @@ -32,8 +32,9 @@ func (n Lnumber) Attribute(key string) interface{} { return n.attributes[key] } -func (n Lnumber) SetAttribute(key string, value interface{}) { +func (n Lnumber) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Lnumber) Position() *node.Position { diff --git a/node/scalar/magic_constant.go b/node/scalar/magic_constant.go index 5263c8d..36d0848 100644 --- a/node/scalar/magic_constant.go +++ b/node/scalar/magic_constant.go @@ -7,7 +7,7 @@ import ( type MagicConstant struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position } func NewMagicConstant(value string) node.Node { @@ -32,8 +32,9 @@ func (n MagicConstant) Attribute(key string) interface{} { return n.attributes[key] } -func (n MagicConstant) SetAttribute(key string, value interface{}) { +func (n MagicConstant) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n MagicConstant) Position() *node.Position { diff --git a/node/scalar/string.go b/node/scalar/string.go index 670ade3..c9946c9 100644 --- a/node/scalar/string.go +++ b/node/scalar/string.go @@ -32,8 +32,9 @@ func (n String) Attribute(key string) interface{} { return n.attributes[key] } -func (n String) SetAttribute(key string, value interface{}) { +func (n String) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n String) Position() *node.Position { diff --git a/node/stmt/alt_else.go b/node/stmt/alt_else.go index e768366..e8c830c 100644 --- a/node/stmt/alt_else.go +++ b/node/stmt/alt_else.go @@ -7,7 +7,7 @@ import ( type AltElse struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position stmt node.Node } @@ -32,8 +32,9 @@ func (n AltElse) Attribute(key string) interface{} { return n.attributes[key] } -func (n AltElse) SetAttribute(key string, value interface{}) { +func (n AltElse) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n AltElse) Position() *node.Position { diff --git a/node/stmt/alt_else_if.go b/node/stmt/alt_else_if.go index 017699e..4e1f53f 100644 --- a/node/stmt/alt_else_if.go +++ b/node/stmt/alt_else_if.go @@ -7,7 +7,7 @@ import ( type AltElseIf struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position cond node.Node stmt node.Node } @@ -34,8 +34,9 @@ func (n AltElseIf) Attribute(key string) interface{} { return n.attributes[key] } -func (n AltElseIf) SetAttribute(key string, value interface{}) { +func (n AltElseIf) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n AltElseIf) Position() *node.Position { diff --git a/node/stmt/alt_if.go b/node/stmt/alt_if.go index 365107c..fc12749 100644 --- a/node/stmt/alt_if.go +++ b/node/stmt/alt_if.go @@ -7,7 +7,7 @@ import ( type AltIf struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position cond node.Node stmt node.Node elseIf []node.Node @@ -38,8 +38,9 @@ func (n AltIf) Attribute(key string) interface{} { return n.attributes[key] } -func (n AltIf) SetAttribute(key string, value interface{}) { +func (n AltIf) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n AltIf) Position() *node.Position { diff --git a/node/stmt/break.go b/node/stmt/break.go index c97c4c4..9cee2a5 100644 --- a/node/stmt/break.go +++ b/node/stmt/break.go @@ -7,7 +7,7 @@ import ( type Break struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position expr node.Node } @@ -32,8 +32,9 @@ func (n Break) Attribute(key string) interface{} { return n.attributes[key] } -func (n Break) SetAttribute(key string, value interface{}) { +func (n Break) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Break) Position() *node.Position { diff --git a/node/stmt/case.go b/node/stmt/case.go index 0a0257c..8f9242f 100644 --- a/node/stmt/case.go +++ b/node/stmt/case.go @@ -7,7 +7,7 @@ import ( type Case struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position cond node.Node stmts []node.Node } @@ -34,8 +34,9 @@ func (n Case) Attribute(key string) interface{} { return n.attributes[key] } -func (n Case) SetAttribute(key string, value interface{}) { +func (n Case) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Case) Position() *node.Position { diff --git a/node/stmt/catch.go b/node/stmt/catch.go index 125db52..42b3bc8 100644 --- a/node/stmt/catch.go +++ b/node/stmt/catch.go @@ -7,7 +7,7 @@ import ( type Catch struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position types []node.Node variable node.Node stmts []node.Node @@ -36,8 +36,9 @@ func (n Catch) Attribute(key string) interface{} { return n.attributes[key] } -func (n Catch) SetAttribute(key string, value interface{}) { +func (n Catch) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Catch) Position() *node.Position { diff --git a/node/stmt/class.go b/node/stmt/class.go index 39c8ba9..19cf36a 100644 --- a/node/stmt/class.go +++ b/node/stmt/class.go @@ -44,8 +44,9 @@ func (n Class) Attribute(key string) interface{} { return n.attributes[key] } -func (n Class) SetAttribute(key string, value interface{}) { +func (n Class) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Class) Position() *node.Position { diff --git a/node/stmt/class_const_list.go b/node/stmt/class_const_list.go index eb18dad..6df5c46 100644 --- a/node/stmt/class_const_list.go +++ b/node/stmt/class_const_list.go @@ -7,7 +7,7 @@ import ( type ClassConstList struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position modifiers []node.Node consts []node.Node } @@ -34,8 +34,9 @@ func (n ClassConstList) Attribute(key string) interface{} { return n.attributes[key] } -func (n ClassConstList) SetAttribute(key string, value interface{}) { +func (n ClassConstList) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n ClassConstList) Position() *node.Position { diff --git a/node/stmt/class_method.go b/node/stmt/class_method.go index a2f7491..239a9a0 100644 --- a/node/stmt/class_method.go +++ b/node/stmt/class_method.go @@ -43,8 +43,9 @@ func (n ClassMethod) Attribute(key string) interface{} { return n.attributes[key] } -func (n ClassMethod) SetAttribute(key string, value interface{}) { +func (n ClassMethod) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n ClassMethod) Position() *node.Position { diff --git a/node/stmt/const_list.go b/node/stmt/const_list.go index e21dc0c..a265367 100644 --- a/node/stmt/const_list.go +++ b/node/stmt/const_list.go @@ -7,7 +7,7 @@ import ( type ConstList struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position consts []node.Node } @@ -32,8 +32,9 @@ func (n ConstList) Attribute(key string) interface{} { return n.attributes[key] } -func (n ConstList) SetAttribute(key string, value interface{}) { +func (n ConstList) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n ConstList) Position() *node.Position { diff --git a/node/stmt/constant.go b/node/stmt/constant.go index 06eb7f9..15c08df 100644 --- a/node/stmt/constant.go +++ b/node/stmt/constant.go @@ -36,8 +36,9 @@ func (n Constant) Attribute(key string) interface{} { return n.attributes[key] } -func (n Constant) SetAttribute(key string, value interface{}) { +func (n Constant) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Constant) Position() *node.Position { diff --git a/node/stmt/continue.go b/node/stmt/continue.go index 65d8a03..c11bca2 100644 --- a/node/stmt/continue.go +++ b/node/stmt/continue.go @@ -7,7 +7,7 @@ import ( type Continue struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position expr node.Node } @@ -32,8 +32,9 @@ func (n Continue) Attribute(key string) interface{} { return n.attributes[key] } -func (n Continue) SetAttribute(key string, value interface{}) { +func (n Continue) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Continue) Position() *node.Position { diff --git a/node/stmt/declare.go b/node/stmt/declare.go index 6c59307..3056599 100644 --- a/node/stmt/declare.go +++ b/node/stmt/declare.go @@ -7,7 +7,7 @@ import ( type Declare struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position consts []node.Node stmt node.Node } @@ -34,8 +34,9 @@ func (n Declare) Attribute(key string) interface{} { return n.attributes[key] } -func (n Declare) SetAttribute(key string, value interface{}) { +func (n Declare) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Declare) Position() *node.Position { diff --git a/node/stmt/default.go b/node/stmt/default.go index 89316e2..b3a9c2d 100644 --- a/node/stmt/default.go +++ b/node/stmt/default.go @@ -7,7 +7,7 @@ import ( type Default struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position stmts []node.Node } @@ -32,8 +32,9 @@ func (n Default) Attribute(key string) interface{} { return n.attributes[key] } -func (n Default) SetAttribute(key string, value interface{}) { +func (n Default) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Default) Position() *node.Position { diff --git a/node/stmt/do.go b/node/stmt/do.go index 24c050b..77393e3 100644 --- a/node/stmt/do.go +++ b/node/stmt/do.go @@ -7,7 +7,7 @@ import ( type Do struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position stmt node.Node cond node.Node } @@ -34,8 +34,9 @@ func (n Do) Attribute(key string) interface{} { return n.attributes[key] } -func (n Do) SetAttribute(key string, value interface{}) { +func (n Do) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Do) Position() *node.Position { diff --git a/node/stmt/echo.go b/node/stmt/echo.go index af1ae84..74bebe6 100644 --- a/node/stmt/echo.go +++ b/node/stmt/echo.go @@ -7,7 +7,7 @@ import ( type Echo struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position exprs []node.Node } @@ -32,8 +32,9 @@ func (n Echo) Attribute(key string) interface{} { return n.attributes[key] } -func (n Echo) SetAttribute(key string, value interface{}) { +func (n Echo) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Echo) Position() *node.Position { diff --git a/node/stmt/else.go b/node/stmt/else.go index 91d661d..4ce58e5 100644 --- a/node/stmt/else.go +++ b/node/stmt/else.go @@ -7,7 +7,7 @@ import ( type Else struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position stmt node.Node } @@ -32,8 +32,9 @@ func (n Else) Attribute(key string) interface{} { return n.attributes[key] } -func (n Else) SetAttribute(key string, value interface{}) { +func (n Else) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Else) Position() *node.Position { diff --git a/node/stmt/else_if.go b/node/stmt/else_if.go index 3b1c306..d54b2b9 100644 --- a/node/stmt/else_if.go +++ b/node/stmt/else_if.go @@ -7,7 +7,7 @@ import ( type ElseIf struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position cond node.Node stmt node.Node } @@ -34,8 +34,9 @@ func (n ElseIf) Attribute(key string) interface{} { return n.attributes[key] } -func (n ElseIf) SetAttribute(key string, value interface{}) { +func (n ElseIf) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n ElseIf) Position() *node.Position { diff --git a/node/stmt/expression.go b/node/stmt/expression.go index a70d362..95a8cbd 100644 --- a/node/stmt/expression.go +++ b/node/stmt/expression.go @@ -7,7 +7,7 @@ import ( type Expression struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position expr node.Node } @@ -32,8 +32,9 @@ func (n Expression) Attribute(key string) interface{} { return n.attributes[key] } -func (n Expression) SetAttribute(key string, value interface{}) { +func (n Expression) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Expression) Position() *node.Position { diff --git a/node/stmt/finally.go b/node/stmt/finally.go index 8cee1cd..4cb907f 100644 --- a/node/stmt/finally.go +++ b/node/stmt/finally.go @@ -7,7 +7,7 @@ import ( type Finally struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position stmts []node.Node } @@ -32,8 +32,9 @@ func (n Finally) Attribute(key string) interface{} { return n.attributes[key] } -func (n Finally) SetAttribute(key string, value interface{}) { +func (n Finally) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Finally) Position() *node.Position { diff --git a/node/stmt/for.go b/node/stmt/for.go index aead82c..58cfbc6 100644 --- a/node/stmt/for.go +++ b/node/stmt/for.go @@ -7,7 +7,7 @@ import ( type For struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position init []node.Node cond []node.Node loop []node.Node @@ -38,8 +38,9 @@ func (n For) Attribute(key string) interface{} { return n.attributes[key] } -func (n For) SetAttribute(key string, value interface{}) { +func (n For) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n For) Position() *node.Position { diff --git a/node/stmt/foreach.go b/node/stmt/foreach.go index ff2fbf7..a5f54dc 100644 --- a/node/stmt/foreach.go +++ b/node/stmt/foreach.go @@ -7,7 +7,7 @@ import ( type Foreach struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position expr node.Node key node.Node variable node.Node @@ -40,8 +40,9 @@ func (n Foreach) Attribute(key string) interface{} { return n.attributes[key] } -func (n Foreach) SetAttribute(key string, value interface{}) { +func (n Foreach) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Foreach) Position() *node.Position { diff --git a/node/stmt/function.go b/node/stmt/function.go index f705672..50e6a65 100644 --- a/node/stmt/function.go +++ b/node/stmt/function.go @@ -41,8 +41,9 @@ func (n Function) Attribute(key string) interface{} { return n.attributes[key] } -func (n Function) SetAttribute(key string, value interface{}) { +func (n Function) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Function) Position() *node.Position { diff --git a/node/stmt/global.go b/node/stmt/global.go index faaef25..8afb7e2 100644 --- a/node/stmt/global.go +++ b/node/stmt/global.go @@ -7,7 +7,7 @@ import ( type Global struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position vars []node.Node } @@ -32,8 +32,9 @@ func (n Global) Attribute(key string) interface{} { return n.attributes[key] } -func (n Global) SetAttribute(key string, value interface{}) { +func (n Global) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Global) Position() *node.Position { diff --git a/node/stmt/goto.go b/node/stmt/goto.go index 1f1e2cf..4ebf71a 100644 --- a/node/stmt/goto.go +++ b/node/stmt/goto.go @@ -7,7 +7,7 @@ import ( type Goto struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position label node.Node } @@ -32,8 +32,9 @@ func (n Goto) Attribute(key string) interface{} { return n.attributes[key] } -func (n Goto) SetAttribute(key string, value interface{}) { +func (n Goto) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Goto) Position() *node.Position { diff --git a/node/stmt/group_use.go b/node/stmt/group_use.go index 7e109e2..e58c168 100644 --- a/node/stmt/group_use.go +++ b/node/stmt/group_use.go @@ -7,7 +7,7 @@ import ( type GroupUse struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position useType node.Node prefix node.Node useList []node.Node @@ -36,8 +36,9 @@ func (n GroupUse) Attribute(key string) interface{} { return n.attributes[key] } -func (n GroupUse) SetAttribute(key string, value interface{}) { +func (n GroupUse) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n GroupUse) Position() *node.Position { diff --git a/node/stmt/halt_compiler.go b/node/stmt/halt_compiler.go index 6e2bca9..d3df311 100644 --- a/node/stmt/halt_compiler.go +++ b/node/stmt/halt_compiler.go @@ -7,7 +7,7 @@ import ( type HaltCompiler struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position } func NewHaltCompiler() node.Node { @@ -30,8 +30,9 @@ func (n HaltCompiler) Attribute(key string) interface{} { return n.attributes[key] } -func (n HaltCompiler) SetAttribute(key string, value interface{}) { +func (n HaltCompiler) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n HaltCompiler) Position() *node.Position { diff --git a/node/stmt/if.go b/node/stmt/if.go index 97f8a24..a538b29 100644 --- a/node/stmt/if.go +++ b/node/stmt/if.go @@ -7,7 +7,7 @@ import ( type If struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position cond node.Node stmt node.Node elseIf []node.Node @@ -38,8 +38,9 @@ func (n If) Attribute(key string) interface{} { return n.attributes[key] } -func (n If) SetAttribute(key string, value interface{}) { +func (n If) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n If) Position() *node.Position { diff --git a/node/stmt/inline_html.go b/node/stmt/inline_html.go index 212fdf8..5272c29 100644 --- a/node/stmt/inline_html.go +++ b/node/stmt/inline_html.go @@ -7,7 +7,7 @@ import ( type InlineHtml struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position } func NewInlineHtml(value string) node.Node { @@ -32,8 +32,9 @@ func (n InlineHtml) Attribute(key string) interface{} { return n.attributes[key] } -func (n InlineHtml) SetAttribute(key string, value interface{}) { +func (n InlineHtml) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n InlineHtml) Position() *node.Position { diff --git a/node/stmt/interface.go b/node/stmt/interface.go index bc2fe13..b88086c 100644 --- a/node/stmt/interface.go +++ b/node/stmt/interface.go @@ -38,8 +38,9 @@ func (n Interface) Attribute(key string) interface{} { return n.attributes[key] } -func (n Interface) SetAttribute(key string, value interface{}) { +func (n Interface) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Interface) Position() *node.Position { diff --git a/node/stmt/label.go b/node/stmt/label.go index cc35bed..8e979fa 100644 --- a/node/stmt/label.go +++ b/node/stmt/label.go @@ -7,7 +7,7 @@ import ( type Label struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position labelName node.Node } @@ -32,8 +32,9 @@ func (n Label) Attribute(key string) interface{} { return n.attributes[key] } -func (n Label) SetAttribute(key string, value interface{}) { +func (n Label) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Label) Position() *node.Position { diff --git a/node/stmt/namespace.go b/node/stmt/namespace.go index 02a0a46..920dd2e 100644 --- a/node/stmt/namespace.go +++ b/node/stmt/namespace.go @@ -7,7 +7,7 @@ import ( type Namespace struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position namespaceName node.Node stmts []node.Node } @@ -34,8 +34,9 @@ func (n Namespace) Attribute(key string) interface{} { return n.attributes[key] } -func (n Namespace) SetAttribute(key string, value interface{}) { +func (n Namespace) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Namespace) Position() *node.Position { diff --git a/node/stmt/nop.go b/node/stmt/nop.go index 886ff4a..e6cca21 100644 --- a/node/stmt/nop.go +++ b/node/stmt/nop.go @@ -7,7 +7,7 @@ import ( type Nop struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position } func NewNop() node.Node { @@ -30,8 +30,9 @@ func (n Nop) Attribute(key string) interface{} { return n.attributes[key] } -func (n Nop) SetAttribute(key string, value interface{}) { +func (n Nop) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Nop) Position() *node.Position { diff --git a/node/stmt/property.go b/node/stmt/property.go index c03dbbc..926ae62 100644 --- a/node/stmt/property.go +++ b/node/stmt/property.go @@ -35,8 +35,9 @@ func (n Property) Attribute(key string) interface{} { return n.attributes[key] } -func (n Property) SetAttribute(key string, value interface{}) { +func (n Property) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Property) Position() *node.Position { diff --git a/node/stmt/property_list.go b/node/stmt/property_list.go index 2a2dc6a..f73783a 100644 --- a/node/stmt/property_list.go +++ b/node/stmt/property_list.go @@ -7,7 +7,7 @@ import ( type PropertyList struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position modifiers []node.Node properties []node.Node } @@ -34,8 +34,9 @@ func (n PropertyList) Attribute(key string) interface{} { return n.attributes[key] } -func (n PropertyList) SetAttribute(key string, value interface{}) { +func (n PropertyList) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n PropertyList) Position() *node.Position { diff --git a/node/stmt/return.go b/node/stmt/return.go index 475582c..907ef58 100644 --- a/node/stmt/return.go +++ b/node/stmt/return.go @@ -7,7 +7,7 @@ import ( type Return struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position expr node.Node } @@ -32,8 +32,9 @@ func (n Return) Attribute(key string) interface{} { return n.attributes[key] } -func (n Return) SetAttribute(key string, value interface{}) { +func (n Return) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Return) Position() *node.Position { diff --git a/node/stmt/static.go b/node/stmt/static.go index 6236f3e..f1a4292 100644 --- a/node/stmt/static.go +++ b/node/stmt/static.go @@ -7,7 +7,7 @@ import ( type Static struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position vars []node.Node } @@ -32,8 +32,9 @@ func (n Static) Attribute(key string) interface{} { return n.attributes[key] } -func (n Static) SetAttribute(key string, value interface{}) { +func (n Static) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Static) Position() *node.Position { diff --git a/node/stmt/static_var.go b/node/stmt/static_var.go index f18f648..c319f99 100644 --- a/node/stmt/static_var.go +++ b/node/stmt/static_var.go @@ -7,7 +7,7 @@ import ( type StaticVar struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position variable node.Node expr node.Node } @@ -34,8 +34,9 @@ func (n StaticVar) Attribute(key string) interface{} { return n.attributes[key] } -func (n StaticVar) SetAttribute(key string, value interface{}) { +func (n StaticVar) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n StaticVar) Position() *node.Position { diff --git a/node/stmt/stmt_list.go b/node/stmt/stmt_list.go index d358095..d257fe2 100644 --- a/node/stmt/stmt_list.go +++ b/node/stmt/stmt_list.go @@ -7,7 +7,7 @@ import ( type StmtList struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position stmts []node.Node } @@ -32,8 +32,9 @@ func (n StmtList) Attribute(key string) interface{} { return n.attributes[key] } -func (n StmtList) SetAttribute(key string, value interface{}) { +func (n StmtList) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n StmtList) Position() *node.Position { diff --git a/node/stmt/switch.go b/node/stmt/switch.go index bb1e60b..70eb4e2 100644 --- a/node/stmt/switch.go +++ b/node/stmt/switch.go @@ -37,8 +37,9 @@ func (n Switch) Attribute(key string) interface{} { return n.attributes[key] } -func (n Switch) SetAttribute(key string, value interface{}) { +func (n Switch) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Switch) Position() *node.Position { diff --git a/node/stmt/throw.go b/node/stmt/throw.go index e4b0e99..d4d3213 100644 --- a/node/stmt/throw.go +++ b/node/stmt/throw.go @@ -7,7 +7,7 @@ import ( type Throw struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position expr node.Node } @@ -32,8 +32,9 @@ func (n Throw) Attribute(key string) interface{} { return n.attributes[key] } -func (n Throw) SetAttribute(key string, value interface{}) { +func (n Throw) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Throw) Position() *node.Position { diff --git a/node/stmt/trait.go b/node/stmt/trait.go index 3a83ac4..fcdef61 100644 --- a/node/stmt/trait.go +++ b/node/stmt/trait.go @@ -36,8 +36,9 @@ func (n Trait) Attribute(key string) interface{} { return n.attributes[key] } -func (n Trait) SetAttribute(key string, value interface{}) { +func (n Trait) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Trait) Position() *node.Position { diff --git a/node/stmt/trait_method_ref.go b/node/stmt/trait_method_ref.go index 7d3b2d3..7a14e89 100644 --- a/node/stmt/trait_method_ref.go +++ b/node/stmt/trait_method_ref.go @@ -7,7 +7,7 @@ import ( type TraitMethodRef struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position trait node.Node method node.Node } @@ -34,8 +34,9 @@ func (n TraitMethodRef) Attribute(key string) interface{} { return n.attributes[key] } -func (n TraitMethodRef) SetAttribute(key string, value interface{}) { +func (n TraitMethodRef) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n TraitMethodRef) Position() *node.Position { diff --git a/node/stmt/trait_use.go b/node/stmt/trait_use.go index ac44ac3..3171ce5 100644 --- a/node/stmt/trait_use.go +++ b/node/stmt/trait_use.go @@ -7,7 +7,7 @@ import ( type TraitUse struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position traits []node.Node adaptations []node.Node } @@ -34,8 +34,9 @@ func (n TraitUse) Attribute(key string) interface{} { return n.attributes[key] } -func (n TraitUse) SetAttribute(key string, value interface{}) { +func (n TraitUse) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n TraitUse) Position() *node.Position { diff --git a/node/stmt/trait_use_alias.go b/node/stmt/trait_use_alias.go index 768223b..03a866b 100644 --- a/node/stmt/trait_use_alias.go +++ b/node/stmt/trait_use_alias.go @@ -7,7 +7,7 @@ import ( type TraitUseAlias struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position ref node.Node modifier node.Node alias node.Node @@ -36,8 +36,9 @@ func (n TraitUseAlias) Attribute(key string) interface{} { return n.attributes[key] } -func (n TraitUseAlias) SetAttribute(key string, value interface{}) { +func (n TraitUseAlias) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n TraitUseAlias) Position() *node.Position { diff --git a/node/stmt/trait_use_precedence.go b/node/stmt/trait_use_precedence.go index 9145452..25e01fe 100644 --- a/node/stmt/trait_use_precedence.go +++ b/node/stmt/trait_use_precedence.go @@ -7,7 +7,7 @@ import ( type TraitUsePrecedence struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position ref node.Node insteadof node.Node } @@ -34,8 +34,9 @@ func (n TraitUsePrecedence) Attribute(key string) interface{} { return n.attributes[key] } -func (n TraitUsePrecedence) SetAttribute(key string, value interface{}) { +func (n TraitUsePrecedence) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n TraitUsePrecedence) Position() *node.Position { diff --git a/node/stmt/try.go b/node/stmt/try.go index 6f24d1a..c2b36b8 100644 --- a/node/stmt/try.go +++ b/node/stmt/try.go @@ -36,8 +36,9 @@ func (n Try) Attribute(key string) interface{} { return n.attributes[key] } -func (n Try) SetAttribute(key string, value interface{}) { +func (n Try) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Try) Position() *node.Position { diff --git a/node/stmt/unset.go b/node/stmt/unset.go index 3afce11..fc20a48 100644 --- a/node/stmt/unset.go +++ b/node/stmt/unset.go @@ -7,7 +7,7 @@ import ( type Unset struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position vars []node.Node } @@ -32,8 +32,9 @@ func (n Unset) Attribute(key string) interface{} { return n.attributes[key] } -func (n Unset) SetAttribute(key string, value interface{}) { +func (n Unset) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Unset) Position() *node.Position { diff --git a/node/stmt/use.go b/node/stmt/use.go index 0ef33df..913db2b 100644 --- a/node/stmt/use.go +++ b/node/stmt/use.go @@ -7,7 +7,7 @@ import ( type Use struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position useType node.Node use node.Node alias node.Node @@ -36,8 +36,9 @@ func (n Use) Attribute(key string) interface{} { return n.attributes[key] } -func (n Use) SetAttribute(key string, value interface{}) { +func (n Use) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n Use) Position() *node.Position { diff --git a/node/stmt/use_list.go b/node/stmt/use_list.go index 120cf18..02e0f02 100644 --- a/node/stmt/use_list.go +++ b/node/stmt/use_list.go @@ -7,7 +7,7 @@ import ( type UseList struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position useType node.Node uses []node.Node } @@ -34,8 +34,9 @@ func (n UseList) Attribute(key string) interface{} { return n.attributes[key] } -func (n UseList) SetAttribute(key string, value interface{}) { +func (n UseList) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n UseList) Position() *node.Position { diff --git a/node/stmt/while.go b/node/stmt/while.go index d464dd1..9181d9d 100644 --- a/node/stmt/while.go +++ b/node/stmt/while.go @@ -8,7 +8,7 @@ import ( type While struct { name string attributes map[string]interface{} - position *node.Position + position *node.Position token token.Token cond node.Node stmt node.Node @@ -37,8 +37,9 @@ func (n While) Attribute(key string) interface{} { return n.attributes[key] } -func (n While) SetAttribute(key string, value interface{}) { +func (n While) SetAttribute(key string, value interface{}) node.Node { n.attributes[key] = value + return n } func (n While) Position() *node.Position {