From dc8808a7d66b424ae6436321dfcd7927a8475ba2 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Thu, 4 Jan 2018 20:42:44 +0200 Subject: [PATCH] constructors return pointer --- node/argument.go | 2 +- node/expr/array.go | 2 +- node/expr/array_dim_fetch.go | 2 +- node/expr/array_item.go | 2 +- node/expr/assign_op/assign.go | 2 +- node/expr/assign_op/assign_ref.go | 2 +- node/expr/assign_op/bitwise_and.go | 2 +- node/expr/assign_op/bitwise_or.go | 2 +- node/expr/assign_op/bitwise_xor.go | 2 +- node/expr/assign_op/concat.go | 2 +- node/expr/assign_op/div.go | 2 +- node/expr/assign_op/minus.go | 2 +- node/expr/assign_op/mod.go | 2 +- node/expr/assign_op/mul.go | 2 +- node/expr/assign_op/plus.go | 2 +- node/expr/assign_op/pow.go | 2 +- node/expr/assign_op/shift_left.go | 2 +- node/expr/assign_op/shift_right.go | 2 +- node/expr/binary_op/bitwise_and.go | 2 +- node/expr/binary_op/bitwise_or.go | 2 +- node/expr/binary_op/bitwise_xor.go | 2 +- node/expr/binary_op/boolean_and.go | 2 +- node/expr/binary_op/boolean_or.go | 2 +- node/expr/binary_op/coalesce.go | 2 +- node/expr/binary_op/concat.go | 2 +- node/expr/binary_op/div.go | 2 +- node/expr/binary_op/equal.go | 2 +- node/expr/binary_op/greater.go | 2 +- node/expr/binary_op/greater_or_equal.go | 2 +- node/expr/binary_op/identical.go | 2 +- node/expr/binary_op/logical_and.go | 2 +- node/expr/binary_op/logical_or.go | 2 +- node/expr/binary_op/logical_xor.go | 2 +- node/expr/binary_op/minus.go | 2 +- node/expr/binary_op/mod.go | 2 +- node/expr/binary_op/mul.go | 2 +- node/expr/binary_op/not_equal.go | 2 +- node/expr/binary_op/not_identical.go | 2 +- node/expr/binary_op/plus.go | 2 +- node/expr/binary_op/pow.go | 2 +- node/expr/binary_op/shift_left.go | 2 +- node/expr/binary_op/shift_right.go | 2 +- node/expr/binary_op/smaller.go | 2 +- node/expr/binary_op/smaller_or_equal.go | 2 +- node/expr/binary_op/spaceship.go | 2 +- node/expr/bitwise_not.go | 2 +- node/expr/boolean_not.go | 2 +- node/expr/cast/cast_array.go | 2 +- node/expr/cast/cast_bool.go | 2 +- node/expr/cast/cast_double.go | 2 +- node/expr/cast/cast_int.go | 2 +- node/expr/cast/cast_object.go | 2 +- node/expr/cast/cast_string.go | 2 +- node/expr/cast/cast_unset.go | 2 +- node/expr/class_const_fetch.go | 2 +- node/expr/clone.go | 2 +- node/expr/closure.go | 2 +- node/expr/closure_use.go | 2 +- node/expr/const_fetch.go | 2 +- node/expr/empty.go | 2 +- node/expr/error_suppress.go | 2 +- node/expr/eval.go | 2 +- node/expr/exit.go | 2 +- node/expr/function_call.go | 2 +- node/expr/include.go | 2 +- node/expr/include_once.go | 2 +- node/expr/instance_of.go | 2 +- node/expr/isset.go | 2 +- node/expr/list.go | 2 +- node/expr/method_call.go | 2 +- node/expr/new.go | 2 +- node/expr/post_dec.go | 2 +- node/expr/post_inc.go | 2 +- node/expr/pre_dec.go | 2 +- node/expr/pre_inc.go | 2 +- node/expr/print.go | 2 +- node/expr/property_fetch.go | 2 +- node/expr/require.go | 2 +- node/expr/require_once.go | 2 +- node/expr/shell_exec.go | 2 +- node/expr/short_array.go | 2 +- node/expr/short_list.go | 2 +- node/expr/static_call.go | 2 +- node/expr/static_property_fetch.go | 2 +- node/expr/ternary.go | 2 +- node/expr/unary_minus.go | 2 +- node/expr/unary_plus.go | 2 +- node/expr/variable.go | 2 +- node/expr/yield.go | 2 +- node/expr/yield_from.go | 2 +- node/identifier.go | 2 +- node/name/fully_qualified.go | 2 +- node/name/name.go | 2 +- node/name/name_part.go | 2 +- node/name/relative.go | 2 +- node/nullable.go | 2 +- node/parameter.go | 2 +- node/scalar/dnumber.go | 2 +- node/scalar/encapsed.go | 2 +- 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 | 2 +- node/stmt/alt_else_if.go | 2 +- node/stmt/alt_if.go | 2 +- node/stmt/break.go | 2 +- node/stmt/case.go | 2 +- node/stmt/catch.go | 2 +- node/stmt/class.go | 2 +- node/stmt/class_const_list.go | 2 +- node/stmt/class_method.go | 2 +- node/stmt/const_list.go | 2 +- node/stmt/constant.go | 2 +- node/stmt/continue.go | 2 +- node/stmt/declare.go | 2 +- node/stmt/default.go | 2 +- node/stmt/do.go | 2 +- node/stmt/echo.go | 2 +- node/stmt/else.go | 2 +- node/stmt/else_if.go | 2 +- node/stmt/expression.go | 2 +- node/stmt/finally.go | 2 +- node/stmt/for.go | 2 +- node/stmt/foreach.go | 2 +- node/stmt/function.go | 2 +- node/stmt/global.go | 2 +- node/stmt/goto.go | 2 +- node/stmt/group_use.go | 2 +- node/stmt/halt_compiler.go | 2 +- node/stmt/if.go | 2 +- node/stmt/inline_html.go | 2 +- node/stmt/interface.go | 2 +- node/stmt/label.go | 2 +- node/stmt/namespace.go | 2 +- node/stmt/nop.go | 2 +- node/stmt/property.go | 2 +- node/stmt/property_list.go | 2 +- node/stmt/return.go | 2 +- node/stmt/static.go | 2 +- node/stmt/static_var.go | 2 +- node/stmt/stmt_list.go | 2 +- node/stmt/switch.go | 2 +- node/stmt/throw.go | 2 +- node/stmt/trait.go | 2 +- node/stmt/trait_method_ref.go | 2 +- node/stmt/trait_use.go | 2 +- node/stmt/trait_use_alias.go | 2 +- node/stmt/trait_use_precedence.go | 2 +- node/stmt/try.go | 2 +- node/stmt/unset.go | 2 +- node/stmt/use.go | 2 +- node/stmt/use_list.go | 2 +- node/stmt/while.go | 2 +- 154 files changed, 154 insertions(+), 154 deletions(-) diff --git a/node/argument.go b/node/argument.go index 26b5f25..5931207 100644 --- a/node/argument.go +++ b/node/argument.go @@ -8,7 +8,7 @@ type Argument struct { } func NewArgument(expression Node, variadic bool) Node { - return Argument{ + return &Argument{ map[string]interface{}{ "variadic": variadic, }, diff --git a/node/expr/array.go b/node/expr/array.go index 0acd346..9cc89d5 100644 --- a/node/expr/array.go +++ b/node/expr/array.go @@ -11,7 +11,7 @@ type Array struct { } func NewArray(items []node.Node) node.Node { - return Array{ + return &Array{ map[string]interface{}{}, nil, items, diff --git a/node/expr/array_dim_fetch.go b/node/expr/array_dim_fetch.go index 3fa99d7..4495e46 100644 --- a/node/expr/array_dim_fetch.go +++ b/node/expr/array_dim_fetch.go @@ -12,7 +12,7 @@ type ArrayDimFetch struct { } func NewArrayDimFetch(variable node.Node, dim node.Node) node.Node { - return ArrayDimFetch{ + return &ArrayDimFetch{ map[string]interface{}{}, nil, variable, diff --git a/node/expr/array_item.go b/node/expr/array_item.go index 312667e..2828638 100644 --- a/node/expr/array_item.go +++ b/node/expr/array_item.go @@ -12,7 +12,7 @@ type ArrayItem struct { } func NewArrayItem(key node.Node, val node.Node, byRef bool) node.Node { - return ArrayItem{ + return &ArrayItem{ map[string]interface{}{ "byRef": byRef, }, diff --git a/node/expr/assign_op/assign.go b/node/expr/assign_op/assign.go index 064230d..f621173 100644 --- a/node/expr/assign_op/assign.go +++ b/node/expr/assign_op/assign.go @@ -9,7 +9,7 @@ type Assign struct { } func NewAssign(variable node.Node, expression node.Node) node.Node { - return Assign{ + return &Assign{ AssignOp{ map[string]interface{}{}, nil, diff --git a/node/expr/assign_op/assign_ref.go b/node/expr/assign_op/assign_ref.go index cdb7eb0..e9bcde5 100644 --- a/node/expr/assign_op/assign_ref.go +++ b/node/expr/assign_op/assign_ref.go @@ -9,7 +9,7 @@ type AssignRef struct { } func NewAssignRef(variable node.Node, expression node.Node) node.Node { - return AssignRef{ + return &AssignRef{ AssignOp{ map[string]interface{}{}, nil, diff --git a/node/expr/assign_op/bitwise_and.go b/node/expr/assign_op/bitwise_and.go index a403f22..f0ec6f7 100644 --- a/node/expr/assign_op/bitwise_and.go +++ b/node/expr/assign_op/bitwise_and.go @@ -9,7 +9,7 @@ type BitwiseAnd struct { } func NewBitwiseAnd(variable node.Node, expression node.Node) node.Node { - return BitwiseAnd{ + return &BitwiseAnd{ AssignOp{ map[string]interface{}{}, nil, diff --git a/node/expr/assign_op/bitwise_or.go b/node/expr/assign_op/bitwise_or.go index d311e7c..445a960 100644 --- a/node/expr/assign_op/bitwise_or.go +++ b/node/expr/assign_op/bitwise_or.go @@ -9,7 +9,7 @@ type BitwiseOr struct { } func NewBitwiseOr(variable node.Node, expression node.Node) node.Node { - return BitwiseOr{ + return &BitwiseOr{ AssignOp{ map[string]interface{}{}, nil, diff --git a/node/expr/assign_op/bitwise_xor.go b/node/expr/assign_op/bitwise_xor.go index c869402..6e87d88 100644 --- a/node/expr/assign_op/bitwise_xor.go +++ b/node/expr/assign_op/bitwise_xor.go @@ -9,7 +9,7 @@ type BitwiseXor struct { } func NewBitwiseXor(variable node.Node, expression node.Node) node.Node { - return BitwiseXor{ + return &BitwiseXor{ AssignOp{ map[string]interface{}{}, nil, diff --git a/node/expr/assign_op/concat.go b/node/expr/assign_op/concat.go index 152bb79..3250791 100644 --- a/node/expr/assign_op/concat.go +++ b/node/expr/assign_op/concat.go @@ -9,7 +9,7 @@ type Concat struct { } func NewConcat(variable node.Node, expression node.Node) node.Node { - return Concat{ + return &Concat{ AssignOp{ map[string]interface{}{}, nil, diff --git a/node/expr/assign_op/div.go b/node/expr/assign_op/div.go index 8ab3465..7bbec81 100644 --- a/node/expr/assign_op/div.go +++ b/node/expr/assign_op/div.go @@ -9,7 +9,7 @@ type Div struct { } func NewDiv(variable node.Node, expression node.Node) node.Node { - return Div{ + return &Div{ AssignOp{ map[string]interface{}{}, nil, diff --git a/node/expr/assign_op/minus.go b/node/expr/assign_op/minus.go index a01bd73..2aa54b7 100644 --- a/node/expr/assign_op/minus.go +++ b/node/expr/assign_op/minus.go @@ -9,7 +9,7 @@ type Minus struct { } func NewMinus(variable node.Node, expression node.Node) node.Node { - return Minus{ + return &Minus{ AssignOp{ map[string]interface{}{}, nil, diff --git a/node/expr/assign_op/mod.go b/node/expr/assign_op/mod.go index e55c011..f06c1f8 100644 --- a/node/expr/assign_op/mod.go +++ b/node/expr/assign_op/mod.go @@ -9,7 +9,7 @@ type Mod struct { } func NewMod(variable node.Node, expression node.Node) node.Node { - return Mod{ + return &Mod{ AssignOp{ map[string]interface{}{}, nil, diff --git a/node/expr/assign_op/mul.go b/node/expr/assign_op/mul.go index db56047..6e6947d 100644 --- a/node/expr/assign_op/mul.go +++ b/node/expr/assign_op/mul.go @@ -9,7 +9,7 @@ type Mul struct { } func NewMul(variable node.Node, expression node.Node) node.Node { - return Mul{ + return &Mul{ AssignOp{ map[string]interface{}{}, nil, diff --git a/node/expr/assign_op/plus.go b/node/expr/assign_op/plus.go index 3ed5384..7e3cbf1 100644 --- a/node/expr/assign_op/plus.go +++ b/node/expr/assign_op/plus.go @@ -9,7 +9,7 @@ type Plus struct { } func NewPlus(variable node.Node, expression node.Node) node.Node { - return Plus{ + return &Plus{ AssignOp{ map[string]interface{}{}, nil, diff --git a/node/expr/assign_op/pow.go b/node/expr/assign_op/pow.go index 117cad2..2e98a6c 100644 --- a/node/expr/assign_op/pow.go +++ b/node/expr/assign_op/pow.go @@ -9,7 +9,7 @@ type Pow struct { } func NewPow(variable node.Node, expression node.Node) node.Node { - return Pow{ + return &Pow{ AssignOp{ map[string]interface{}{}, nil, diff --git a/node/expr/assign_op/shift_left.go b/node/expr/assign_op/shift_left.go index a6576bf..ef5e13b 100644 --- a/node/expr/assign_op/shift_left.go +++ b/node/expr/assign_op/shift_left.go @@ -9,7 +9,7 @@ type ShiftLeft struct { } func NewShiftLeft(variable node.Node, expression node.Node) node.Node { - return ShiftLeft{ + return &ShiftLeft{ AssignOp{ map[string]interface{}{}, nil, diff --git a/node/expr/assign_op/shift_right.go b/node/expr/assign_op/shift_right.go index 2b46161..370841f 100644 --- a/node/expr/assign_op/shift_right.go +++ b/node/expr/assign_op/shift_right.go @@ -9,7 +9,7 @@ type ShiftRight struct { } func NewShiftRight(variable node.Node, expression node.Node) node.Node { - return ShiftRight{ + return &ShiftRight{ AssignOp{ map[string]interface{}{}, nil, diff --git a/node/expr/binary_op/bitwise_and.go b/node/expr/binary_op/bitwise_and.go index 1b4a1eb..0c3c73d 100644 --- a/node/expr/binary_op/bitwise_and.go +++ b/node/expr/binary_op/bitwise_and.go @@ -9,7 +9,7 @@ type BitwiseAnd struct { } func NewBitwiseAnd(variable node.Node, expression node.Node) node.Node { - return BitwiseAnd{ + return &BitwiseAnd{ BinaryOp{ map[string]interface{}{}, nil, diff --git a/node/expr/binary_op/bitwise_or.go b/node/expr/binary_op/bitwise_or.go index bc5f9ea..1e5d366 100644 --- a/node/expr/binary_op/bitwise_or.go +++ b/node/expr/binary_op/bitwise_or.go @@ -9,7 +9,7 @@ type BitwiseOr struct { } func NewBitwiseOr(variable node.Node, expression node.Node) node.Node { - return BitwiseOr{ + return &BitwiseOr{ BinaryOp{ map[string]interface{}{}, nil, diff --git a/node/expr/binary_op/bitwise_xor.go b/node/expr/binary_op/bitwise_xor.go index e3cfac1..6861962 100644 --- a/node/expr/binary_op/bitwise_xor.go +++ b/node/expr/binary_op/bitwise_xor.go @@ -9,7 +9,7 @@ type BitwiseXor struct { } func NewBitwiseXor(variable node.Node, expression node.Node) node.Node { - return BitwiseXor{ + return &BitwiseXor{ BinaryOp{ map[string]interface{}{}, nil, diff --git a/node/expr/binary_op/boolean_and.go b/node/expr/binary_op/boolean_and.go index 2985fc4..25256de 100644 --- a/node/expr/binary_op/boolean_and.go +++ b/node/expr/binary_op/boolean_and.go @@ -9,7 +9,7 @@ type BooleanAnd struct { } func NewBooleanAnd(variable node.Node, expression node.Node) node.Node { - return BooleanAnd{ + return &BooleanAnd{ BinaryOp{ map[string]interface{}{}, nil, diff --git a/node/expr/binary_op/boolean_or.go b/node/expr/binary_op/boolean_or.go index 10731c4..73de47e 100644 --- a/node/expr/binary_op/boolean_or.go +++ b/node/expr/binary_op/boolean_or.go @@ -9,7 +9,7 @@ type BooleanOr struct { } func NewBooleanOr(variable node.Node, expression node.Node) node.Node { - return BooleanOr{ + return &BooleanOr{ BinaryOp{ map[string]interface{}{}, nil, diff --git a/node/expr/binary_op/coalesce.go b/node/expr/binary_op/coalesce.go index a8183bb..35ab0fa 100644 --- a/node/expr/binary_op/coalesce.go +++ b/node/expr/binary_op/coalesce.go @@ -9,7 +9,7 @@ type Coalesce struct { } func NewCoalesce(variable node.Node, expression node.Node) node.Node { - return Coalesce{ + return &Coalesce{ BinaryOp{ map[string]interface{}{}, nil, diff --git a/node/expr/binary_op/concat.go b/node/expr/binary_op/concat.go index 5b623e6..865f901 100644 --- a/node/expr/binary_op/concat.go +++ b/node/expr/binary_op/concat.go @@ -9,7 +9,7 @@ type Concat struct { } func NewConcat(variable node.Node, expression node.Node) node.Node { - return Concat{ + return &Concat{ BinaryOp{ map[string]interface{}{}, nil, diff --git a/node/expr/binary_op/div.go b/node/expr/binary_op/div.go index eb32611..39f18b0 100644 --- a/node/expr/binary_op/div.go +++ b/node/expr/binary_op/div.go @@ -9,7 +9,7 @@ type Div struct { } func NewDiv(variable node.Node, expression node.Node) node.Node { - return Div{ + return &Div{ BinaryOp{ map[string]interface{}{}, nil, diff --git a/node/expr/binary_op/equal.go b/node/expr/binary_op/equal.go index e82ddc2..0c57959 100644 --- a/node/expr/binary_op/equal.go +++ b/node/expr/binary_op/equal.go @@ -9,7 +9,7 @@ type Equal struct { } func NewEqual(variable node.Node, expression node.Node) node.Node { - return Equal{ + return &Equal{ BinaryOp{ map[string]interface{}{}, nil, diff --git a/node/expr/binary_op/greater.go b/node/expr/binary_op/greater.go index 6b2ce2b..93284bb 100644 --- a/node/expr/binary_op/greater.go +++ b/node/expr/binary_op/greater.go @@ -9,7 +9,7 @@ type Greater struct { } func NewGreater(variable node.Node, expression node.Node) node.Node { - return Greater{ + return &Greater{ BinaryOp{ map[string]interface{}{}, nil, diff --git a/node/expr/binary_op/greater_or_equal.go b/node/expr/binary_op/greater_or_equal.go index a0c6165..06927b0 100644 --- a/node/expr/binary_op/greater_or_equal.go +++ b/node/expr/binary_op/greater_or_equal.go @@ -9,7 +9,7 @@ type GreaterOrEqual struct { } func NewGreaterOrEqual(variable node.Node, expression node.Node) node.Node { - return GreaterOrEqual{ + return &GreaterOrEqual{ BinaryOp{ map[string]interface{}{}, nil, diff --git a/node/expr/binary_op/identical.go b/node/expr/binary_op/identical.go index 0b71f05..f52a908 100644 --- a/node/expr/binary_op/identical.go +++ b/node/expr/binary_op/identical.go @@ -9,7 +9,7 @@ type Identical struct { } func NewIdentical(variable node.Node, expression node.Node) node.Node { - return Identical{ + return &Identical{ BinaryOp{ map[string]interface{}{}, nil, diff --git a/node/expr/binary_op/logical_and.go b/node/expr/binary_op/logical_and.go index ba81ba3..7e4fd40 100644 --- a/node/expr/binary_op/logical_and.go +++ b/node/expr/binary_op/logical_and.go @@ -9,7 +9,7 @@ type LogicalAnd struct { } func NewLogicalAnd(variable node.Node, expression node.Node) node.Node { - return LogicalAnd{ + return &LogicalAnd{ BinaryOp{ map[string]interface{}{}, nil, diff --git a/node/expr/binary_op/logical_or.go b/node/expr/binary_op/logical_or.go index 16afd9b..3062408 100644 --- a/node/expr/binary_op/logical_or.go +++ b/node/expr/binary_op/logical_or.go @@ -9,7 +9,7 @@ type LogicalOr struct { } func NewLogicalOr(variable node.Node, expression node.Node) node.Node { - return LogicalOr{ + return &LogicalOr{ BinaryOp{ map[string]interface{}{}, nil, diff --git a/node/expr/binary_op/logical_xor.go b/node/expr/binary_op/logical_xor.go index 8a7c87e..ade1c3b 100644 --- a/node/expr/binary_op/logical_xor.go +++ b/node/expr/binary_op/logical_xor.go @@ -9,7 +9,7 @@ type LogicalXor struct { } func NewLogicalXor(variable node.Node, expression node.Node) node.Node { - return LogicalXor{ + return &LogicalXor{ BinaryOp{ map[string]interface{}{}, nil, diff --git a/node/expr/binary_op/minus.go b/node/expr/binary_op/minus.go index daba4c0..6a97efc 100644 --- a/node/expr/binary_op/minus.go +++ b/node/expr/binary_op/minus.go @@ -9,7 +9,7 @@ type Minus struct { } func NewMinus(variable node.Node, expression node.Node) node.Node { - return Minus{ + return &Minus{ BinaryOp{ map[string]interface{}{}, nil, diff --git a/node/expr/binary_op/mod.go b/node/expr/binary_op/mod.go index f8e8820..1bd9d9b 100644 --- a/node/expr/binary_op/mod.go +++ b/node/expr/binary_op/mod.go @@ -9,7 +9,7 @@ type Mod struct { } func NewMod(variable node.Node, expression node.Node) node.Node { - return Mod{ + return &Mod{ BinaryOp{ map[string]interface{}{}, nil, diff --git a/node/expr/binary_op/mul.go b/node/expr/binary_op/mul.go index 0c40a58..260f0df 100644 --- a/node/expr/binary_op/mul.go +++ b/node/expr/binary_op/mul.go @@ -9,7 +9,7 @@ type Mul struct { } func NewMul(variable node.Node, expression node.Node) node.Node { - return Mul{ + return &Mul{ BinaryOp{ map[string]interface{}{}, nil, diff --git a/node/expr/binary_op/not_equal.go b/node/expr/binary_op/not_equal.go index 5396679..3c36fa4 100644 --- a/node/expr/binary_op/not_equal.go +++ b/node/expr/binary_op/not_equal.go @@ -9,7 +9,7 @@ type NotEqual struct { } func NewNotEqual(variable node.Node, expression node.Node) node.Node { - return NotEqual{ + return &NotEqual{ BinaryOp{ map[string]interface{}{}, nil, diff --git a/node/expr/binary_op/not_identical.go b/node/expr/binary_op/not_identical.go index 74dad65..b2649c7 100644 --- a/node/expr/binary_op/not_identical.go +++ b/node/expr/binary_op/not_identical.go @@ -9,7 +9,7 @@ type NotIdentical struct { } func NewNotIdentical(variable node.Node, expression node.Node) node.Node { - return NotIdentical{ + return &NotIdentical{ BinaryOp{ map[string]interface{}{}, nil, diff --git a/node/expr/binary_op/plus.go b/node/expr/binary_op/plus.go index 31370d5..0ff6216 100644 --- a/node/expr/binary_op/plus.go +++ b/node/expr/binary_op/plus.go @@ -9,7 +9,7 @@ type Plus struct { } func NewPlus(variable node.Node, expression node.Node) node.Node { - return Plus{ + return &Plus{ BinaryOp{ map[string]interface{}{}, nil, diff --git a/node/expr/binary_op/pow.go b/node/expr/binary_op/pow.go index 868b051..ab34c41 100644 --- a/node/expr/binary_op/pow.go +++ b/node/expr/binary_op/pow.go @@ -9,7 +9,7 @@ type Pow struct { } func NewPow(variable node.Node, expression node.Node) node.Node { - return Pow{ + return &Pow{ BinaryOp{ map[string]interface{}{}, nil, diff --git a/node/expr/binary_op/shift_left.go b/node/expr/binary_op/shift_left.go index 1ca013a..afe7bee 100644 --- a/node/expr/binary_op/shift_left.go +++ b/node/expr/binary_op/shift_left.go @@ -9,7 +9,7 @@ type ShiftLeft struct { } func NewShiftLeft(variable node.Node, expression node.Node) node.Node { - return ShiftLeft{ + return &ShiftLeft{ BinaryOp{ map[string]interface{}{}, nil, diff --git a/node/expr/binary_op/shift_right.go b/node/expr/binary_op/shift_right.go index 4dd8604..795b033 100644 --- a/node/expr/binary_op/shift_right.go +++ b/node/expr/binary_op/shift_right.go @@ -9,7 +9,7 @@ type ShiftRight struct { } func NewShiftRight(variable node.Node, expression node.Node) node.Node { - return ShiftRight{ + return &ShiftRight{ BinaryOp{ map[string]interface{}{}, nil, diff --git a/node/expr/binary_op/smaller.go b/node/expr/binary_op/smaller.go index e2dbb31..85716d0 100644 --- a/node/expr/binary_op/smaller.go +++ b/node/expr/binary_op/smaller.go @@ -9,7 +9,7 @@ type Smaller struct { } func NewSmaller(variable node.Node, expression node.Node) node.Node { - return Smaller{ + return &Smaller{ BinaryOp{ map[string]interface{}{}, nil, diff --git a/node/expr/binary_op/smaller_or_equal.go b/node/expr/binary_op/smaller_or_equal.go index eaf9718..144861e 100644 --- a/node/expr/binary_op/smaller_or_equal.go +++ b/node/expr/binary_op/smaller_or_equal.go @@ -9,7 +9,7 @@ type SmallerOrEqual struct { } func NewSmallerOrEqual(variable node.Node, expression node.Node) node.Node { - return SmallerOrEqual{ + return &SmallerOrEqual{ BinaryOp{ map[string]interface{}{}, nil, diff --git a/node/expr/binary_op/spaceship.go b/node/expr/binary_op/spaceship.go index 9f9fa9b..10d6542 100644 --- a/node/expr/binary_op/spaceship.go +++ b/node/expr/binary_op/spaceship.go @@ -9,7 +9,7 @@ type Spaceship struct { } func NewSpaceship(variable node.Node, expression node.Node) node.Node { - return Spaceship{ + return &Spaceship{ BinaryOp{ map[string]interface{}{}, nil, diff --git a/node/expr/bitwise_not.go b/node/expr/bitwise_not.go index abaa508..61b117f 100644 --- a/node/expr/bitwise_not.go +++ b/node/expr/bitwise_not.go @@ -11,7 +11,7 @@ type BitwiseNot struct { } func NewBitwiseNot(expression node.Node) node.Node { - return BitwiseNot{ + return &BitwiseNot{ map[string]interface{}{}, nil, expression, diff --git a/node/expr/boolean_not.go b/node/expr/boolean_not.go index a0850eb..152d9c4 100644 --- a/node/expr/boolean_not.go +++ b/node/expr/boolean_not.go @@ -11,7 +11,7 @@ type BooleanNot struct { } func NewBooleanNot(expression node.Node) node.Node { - return BooleanNot{ + return &BooleanNot{ map[string]interface{}{}, nil, expression, diff --git a/node/expr/cast/cast_array.go b/node/expr/cast/cast_array.go index b737792..ef08232 100644 --- a/node/expr/cast/cast_array.go +++ b/node/expr/cast/cast_array.go @@ -9,7 +9,7 @@ type CastArray struct { } func NewCastArray(expr node.Node) node.Node { - return CastArray{ + return &CastArray{ Cast{ map[string]interface{}{}, nil, diff --git a/node/expr/cast/cast_bool.go b/node/expr/cast/cast_bool.go index feecea6..f19963c 100644 --- a/node/expr/cast/cast_bool.go +++ b/node/expr/cast/cast_bool.go @@ -9,7 +9,7 @@ type CastBool struct { } func NewCastBool(expr node.Node) node.Node { - return CastBool{ + return &CastBool{ Cast{ map[string]interface{}{}, nil, diff --git a/node/expr/cast/cast_double.go b/node/expr/cast/cast_double.go index f74be8a..abbaa78 100644 --- a/node/expr/cast/cast_double.go +++ b/node/expr/cast/cast_double.go @@ -9,7 +9,7 @@ type CastDouble struct { } func NewCastDouble(expr node.Node) node.Node { - return CastDouble{ + return &CastDouble{ Cast{ map[string]interface{}{}, nil, diff --git a/node/expr/cast/cast_int.go b/node/expr/cast/cast_int.go index d125cd8..97b8b6c 100644 --- a/node/expr/cast/cast_int.go +++ b/node/expr/cast/cast_int.go @@ -9,7 +9,7 @@ type CastInt struct { } func NewCastInt(expr node.Node) node.Node { - return CastInt{ + return &CastInt{ Cast{ map[string]interface{}{}, nil, diff --git a/node/expr/cast/cast_object.go b/node/expr/cast/cast_object.go index d66cb1b..daa3e86 100644 --- a/node/expr/cast/cast_object.go +++ b/node/expr/cast/cast_object.go @@ -9,7 +9,7 @@ type CastObject struct { } func NewCastObject(expr node.Node) node.Node { - return CastObject{ + return &CastObject{ Cast{ map[string]interface{}{}, nil, diff --git a/node/expr/cast/cast_string.go b/node/expr/cast/cast_string.go index 929e7b9..5f2dc48 100644 --- a/node/expr/cast/cast_string.go +++ b/node/expr/cast/cast_string.go @@ -9,7 +9,7 @@ type CastString struct { } func NewCastString(expr node.Node) node.Node { - return CastString{ + return &CastString{ Cast{ map[string]interface{}{}, nil, diff --git a/node/expr/cast/cast_unset.go b/node/expr/cast/cast_unset.go index 3e54841..0207f59 100644 --- a/node/expr/cast/cast_unset.go +++ b/node/expr/cast/cast_unset.go @@ -9,7 +9,7 @@ type CastUnset struct { } func NewCastUnset(expr node.Node) node.Node { - return CastUnset{ + return &CastUnset{ Cast{ map[string]interface{}{}, nil, diff --git a/node/expr/class_const_fetch.go b/node/expr/class_const_fetch.go index d69693d..d970079 100644 --- a/node/expr/class_const_fetch.go +++ b/node/expr/class_const_fetch.go @@ -12,7 +12,7 @@ type ClassConstFetch struct { } func NewClassConstFetch(class node.Node, constantName node.Node) node.Node { - return ClassConstFetch{ + return &ClassConstFetch{ map[string]interface{}{}, nil, class, diff --git a/node/expr/clone.go b/node/expr/clone.go index 8a8e802..e35374d 100644 --- a/node/expr/clone.go +++ b/node/expr/clone.go @@ -11,7 +11,7 @@ type Clone struct { } func NewClone(expression node.Node) node.Node { - return Clone{ + return &Clone{ map[string]interface{}{}, nil, expression, diff --git a/node/expr/closure.go b/node/expr/closure.go index 14bf951..2dd4522 100644 --- a/node/expr/closure.go +++ b/node/expr/closure.go @@ -14,7 +14,7 @@ type Closure struct { } func NewClosure(params []node.Node, uses []node.Node, returnType node.Node, stmts []node.Node, isStatic bool, isReturnRef bool, phpDocComment string) node.Node { - return Closure{ + return &Closure{ map[string]interface{}{ "isReturnRef": isReturnRef, "isStatic": isStatic, diff --git a/node/expr/closure_use.go b/node/expr/closure_use.go index a4a77af..dd3fb44 100644 --- a/node/expr/closure_use.go +++ b/node/expr/closure_use.go @@ -11,7 +11,7 @@ type ClusureUse struct { } func NewClusureUse(variable node.Node, byRef bool) node.Node { - return ClusureUse{ + return &ClusureUse{ map[string]interface{}{ "byRef": byRef, }, diff --git a/node/expr/const_fetch.go b/node/expr/const_fetch.go index 08a1daf..a339aec 100644 --- a/node/expr/const_fetch.go +++ b/node/expr/const_fetch.go @@ -11,7 +11,7 @@ type ConstFetch struct { } func NewConstFetch(constant node.Node) node.Node { - return ConstFetch{ + return &ConstFetch{ map[string]interface{}{}, nil, constant, diff --git a/node/expr/empty.go b/node/expr/empty.go index ab2b19d..4a8d63a 100644 --- a/node/expr/empty.go +++ b/node/expr/empty.go @@ -11,7 +11,7 @@ type Empty struct { } func NewEmpty(expression node.Node) node.Node { - return Empty{ + return &Empty{ map[string]interface{}{}, nil, expression, diff --git a/node/expr/error_suppress.go b/node/expr/error_suppress.go index fb07754..39e1555 100644 --- a/node/expr/error_suppress.go +++ b/node/expr/error_suppress.go @@ -11,7 +11,7 @@ type ErrorSuppress struct { } func NewErrorSuppress(expression node.Node) node.Node { - return ErrorSuppress{ + return &ErrorSuppress{ map[string]interface{}{}, nil, expression, diff --git a/node/expr/eval.go b/node/expr/eval.go index 46454ca..a56e612 100644 --- a/node/expr/eval.go +++ b/node/expr/eval.go @@ -11,7 +11,7 @@ type Eval struct { } func NewEval(expression node.Node) node.Node { - return Eval{ + return &Eval{ map[string]interface{}{}, nil, expression, diff --git a/node/expr/exit.go b/node/expr/exit.go index 4d6fb48..6ac783e 100644 --- a/node/expr/exit.go +++ b/node/expr/exit.go @@ -11,7 +11,7 @@ type Exit struct { } func NewExit(expr node.Node, isDie bool) node.Node { - return Exit{ + return &Exit{ map[string]interface{}{ "isDie": isDie, }, diff --git a/node/expr/function_call.go b/node/expr/function_call.go index dbcd024..5cef8dd 100644 --- a/node/expr/function_call.go +++ b/node/expr/function_call.go @@ -12,7 +12,7 @@ type FunctionCall struct { } func NewFunctionCall(function node.Node, arguments []node.Node) node.Node { - return FunctionCall{ + return &FunctionCall{ map[string]interface{}{}, nil, function, diff --git a/node/expr/include.go b/node/expr/include.go index 6deb185..c5218c1 100644 --- a/node/expr/include.go +++ b/node/expr/include.go @@ -11,7 +11,7 @@ type Include struct { } func NewInclude(expression node.Node) node.Node { - return Include{ + return &Include{ map[string]interface{}{}, nil, expression, diff --git a/node/expr/include_once.go b/node/expr/include_once.go index 8997933..b687e2a 100644 --- a/node/expr/include_once.go +++ b/node/expr/include_once.go @@ -11,7 +11,7 @@ type IncludeOnce struct { } func NewIncludeOnce(expression node.Node) node.Node { - return IncludeOnce{ + return &IncludeOnce{ map[string]interface{}{}, nil, expression, diff --git a/node/expr/instance_of.go b/node/expr/instance_of.go index 503f7d1..d7cff55 100644 --- a/node/expr/instance_of.go +++ b/node/expr/instance_of.go @@ -12,7 +12,7 @@ type InstanceOf struct { } func NewInstanceOf(expr node.Node, class node.Node) node.Node { - return InstanceOf{ + return &InstanceOf{ map[string]interface{}{}, nil, expr, diff --git a/node/expr/isset.go b/node/expr/isset.go index 725da82..748f8d3 100644 --- a/node/expr/isset.go +++ b/node/expr/isset.go @@ -11,7 +11,7 @@ type Isset struct { } func NewIsset(variables []node.Node) node.Node { - return Isset{ + return &Isset{ map[string]interface{}{}, nil, variables, diff --git a/node/expr/list.go b/node/expr/list.go index 549301f..20acf36 100644 --- a/node/expr/list.go +++ b/node/expr/list.go @@ -11,7 +11,7 @@ type List struct { } func NewList(items []node.Node) node.Node { - return List{ + return &List{ map[string]interface{}{}, nil, items, diff --git a/node/expr/method_call.go b/node/expr/method_call.go index 9e96384..62367fe 100644 --- a/node/expr/method_call.go +++ b/node/expr/method_call.go @@ -13,7 +13,7 @@ type MethodCall struct { } func NewMethodCall(variable node.Node, method node.Node, arguments []node.Node) node.Node { - return MethodCall{ + return &MethodCall{ map[string]interface{}{}, nil, variable, diff --git a/node/expr/new.go b/node/expr/new.go index eaa7e7b..f17ae5c 100644 --- a/node/expr/new.go +++ b/node/expr/new.go @@ -12,7 +12,7 @@ type New struct { } func NewNew(class node.Node, arguments []node.Node) node.Node { - return New{ + return &New{ map[string]interface{}{}, nil, class, diff --git a/node/expr/post_dec.go b/node/expr/post_dec.go index a0fc1ff..67fdce9 100644 --- a/node/expr/post_dec.go +++ b/node/expr/post_dec.go @@ -11,7 +11,7 @@ type PostDec struct { } func NewPostDec(variable node.Node) node.Node { - return PostDec{ + return &PostDec{ map[string]interface{}{}, nil, variable, diff --git a/node/expr/post_inc.go b/node/expr/post_inc.go index 0731a8a..d7c55a1 100644 --- a/node/expr/post_inc.go +++ b/node/expr/post_inc.go @@ -11,7 +11,7 @@ type PostInc struct { } func NewPostInc(variable node.Node) node.Node { - return PostInc{ + return &PostInc{ map[string]interface{}{}, nil, variable, diff --git a/node/expr/pre_dec.go b/node/expr/pre_dec.go index 0e194af..07b6566 100644 --- a/node/expr/pre_dec.go +++ b/node/expr/pre_dec.go @@ -11,7 +11,7 @@ type PreDec struct { } func NewPreDec(variable node.Node) node.Node { - return PreDec{ + return &PreDec{ map[string]interface{}{}, nil, variable, diff --git a/node/expr/pre_inc.go b/node/expr/pre_inc.go index 5243b28..0f0ea3d 100644 --- a/node/expr/pre_inc.go +++ b/node/expr/pre_inc.go @@ -11,7 +11,7 @@ type PreInc struct { } func NewPreInc(variable node.Node) node.Node { - return PreInc{ + return &PreInc{ map[string]interface{}{}, nil, variable, diff --git a/node/expr/print.go b/node/expr/print.go index 59e5297..8e0bfc6 100644 --- a/node/expr/print.go +++ b/node/expr/print.go @@ -11,7 +11,7 @@ type Print struct { } func NewPrint(expression node.Node) node.Node { - return Print{ + return &Print{ map[string]interface{}{}, nil, expression, diff --git a/node/expr/property_fetch.go b/node/expr/property_fetch.go index 3f1e3d0..16b8ef0 100644 --- a/node/expr/property_fetch.go +++ b/node/expr/property_fetch.go @@ -12,7 +12,7 @@ type PropertyFetch struct { } func NewPropertyFetch(variable node.Node, property node.Node) node.Node { - return PropertyFetch{ + return &PropertyFetch{ map[string]interface{}{}, nil, variable, diff --git a/node/expr/require.go b/node/expr/require.go index b6308b3..d4bd2f6 100644 --- a/node/expr/require.go +++ b/node/expr/require.go @@ -11,7 +11,7 @@ type Require struct { } func NewRequire(expression node.Node) node.Node { - return Require{ + return &Require{ map[string]interface{}{}, nil, expression, diff --git a/node/expr/require_once.go b/node/expr/require_once.go index 5e5353e..85abf83 100644 --- a/node/expr/require_once.go +++ b/node/expr/require_once.go @@ -11,7 +11,7 @@ type RequireOnce struct { } func NewRequireOnce(expression node.Node) node.Node { - return RequireOnce{ + return &RequireOnce{ map[string]interface{}{}, nil, expression, diff --git a/node/expr/shell_exec.go b/node/expr/shell_exec.go index 41f0e63..28db5fb 100644 --- a/node/expr/shell_exec.go +++ b/node/expr/shell_exec.go @@ -11,7 +11,7 @@ type ShellExec struct { } func NewShellExec(parts []node.Node) node.Node { - return ShellExec{ + return &ShellExec{ map[string]interface{}{}, nil, parts, diff --git a/node/expr/short_array.go b/node/expr/short_array.go index f92c111..590c9ec 100644 --- a/node/expr/short_array.go +++ b/node/expr/short_array.go @@ -11,7 +11,7 @@ type ShortArray struct { } func NewShortArray(items []node.Node) node.Node { - return ShortArray{ + return &ShortArray{ map[string]interface{}{}, nil, items, diff --git a/node/expr/short_list.go b/node/expr/short_list.go index 2c9afd1..cd91d7e 100644 --- a/node/expr/short_list.go +++ b/node/expr/short_list.go @@ -11,7 +11,7 @@ type ShortList struct { } func NewShortList(items []node.Node) node.Node { - return ShortList{ + return &ShortList{ map[string]interface{}{}, nil, items, diff --git a/node/expr/static_call.go b/node/expr/static_call.go index e1411b0..6e542bf 100644 --- a/node/expr/static_call.go +++ b/node/expr/static_call.go @@ -13,7 +13,7 @@ type StaticCall struct { } func NewStaticCall(class node.Node, call node.Node, arguments []node.Node) node.Node { - return StaticCall{ + return &StaticCall{ map[string]interface{}{}, nil, class, diff --git a/node/expr/static_property_fetch.go b/node/expr/static_property_fetch.go index b377fcd..63cd4d5 100644 --- a/node/expr/static_property_fetch.go +++ b/node/expr/static_property_fetch.go @@ -12,7 +12,7 @@ type StaticPropertyFetch struct { } func NewStaticPropertyFetch(class node.Node, property node.Node) node.Node { - return StaticPropertyFetch{ + return &StaticPropertyFetch{ map[string]interface{}{}, nil, class, diff --git a/node/expr/ternary.go b/node/expr/ternary.go index e0cdbc5..f4efd6f 100644 --- a/node/expr/ternary.go +++ b/node/expr/ternary.go @@ -13,7 +13,7 @@ type Ternary struct { } func NewTernary(condition node.Node, ifTrue node.Node, ifFalse node.Node) node.Node { - return Ternary{ + return &Ternary{ map[string]interface{}{}, nil, condition, diff --git a/node/expr/unary_minus.go b/node/expr/unary_minus.go index 3ae5c39..146a7c9 100644 --- a/node/expr/unary_minus.go +++ b/node/expr/unary_minus.go @@ -11,7 +11,7 @@ type UnaryMinus struct { } func NewUnaryMinus(expression node.Node) node.Node { - return UnaryMinus{ + return &UnaryMinus{ map[string]interface{}{}, nil, expression, diff --git a/node/expr/unary_plus.go b/node/expr/unary_plus.go index f84eaae..ea45fb3 100644 --- a/node/expr/unary_plus.go +++ b/node/expr/unary_plus.go @@ -11,7 +11,7 @@ type UnaryPlus struct { } func NewUnaryPlus(expression node.Node) node.Node { - return UnaryPlus{ + return &UnaryPlus{ map[string]interface{}{}, nil, expression, diff --git a/node/expr/variable.go b/node/expr/variable.go index a0d0da3..430932a 100644 --- a/node/expr/variable.go +++ b/node/expr/variable.go @@ -11,7 +11,7 @@ type Variable struct { } func NewVariable(varName node.Node) node.Node { - return Variable{ + return &Variable{ map[string]interface{}{}, nil, varName, diff --git a/node/expr/yield.go b/node/expr/yield.go index 07d6956..2e172ff 100644 --- a/node/expr/yield.go +++ b/node/expr/yield.go @@ -12,7 +12,7 @@ type Yield struct { } func NewYield(key node.Node, value node.Node) node.Node { - return Yield{ + return &Yield{ map[string]interface{}{}, nil, key, diff --git a/node/expr/yield_from.go b/node/expr/yield_from.go index af82584..3051f3f 100644 --- a/node/expr/yield_from.go +++ b/node/expr/yield_from.go @@ -11,7 +11,7 @@ type YieldFrom struct { } func NewYieldFrom(expression node.Node) node.Node { - return YieldFrom{ + return &YieldFrom{ map[string]interface{}{}, nil, expression, diff --git a/node/identifier.go b/node/identifier.go index eb903e1..dd219e8 100644 --- a/node/identifier.go +++ b/node/identifier.go @@ -10,7 +10,7 @@ type Identifier struct { } func NewIdentifier(token token.Token) Node { - return Identifier{ + return &Identifier{ map[string]interface{}{ "value": token.Value, }, diff --git a/node/name/fully_qualified.go b/node/name/fully_qualified.go index fe83e2a..8a925fb 100644 --- a/node/name/fully_qualified.go +++ b/node/name/fully_qualified.go @@ -9,7 +9,7 @@ type FullyQualified struct { } func NewFullyQualified(parts []node.Node) node.Node { - return FullyQualified{ + return &FullyQualified{ Name{ map[string]interface{}{}, nil, diff --git a/node/name/name.go b/node/name/name.go index 8bed000..b3dad56 100644 --- a/node/name/name.go +++ b/node/name/name.go @@ -11,7 +11,7 @@ type Name struct { } func NewName(parts []node.Node) node.Node { - return Name{ + return &Name{ map[string]interface{}{}, nil, parts, diff --git a/node/name/name_part.go b/node/name/name_part.go index f10292e..c8c2003 100644 --- a/node/name/name_part.go +++ b/node/name/name_part.go @@ -10,7 +10,7 @@ type NamePart struct { } func NewNamePart(value string) node.Node { - return NamePart{ + return &NamePart{ map[string]interface{}{ "value": value, }, diff --git a/node/name/relative.go b/node/name/relative.go index 0b14bd6..30048c1 100644 --- a/node/name/relative.go +++ b/node/name/relative.go @@ -9,7 +9,7 @@ type Relative struct { } func NewRelative(parts []node.Node) node.Node { - return Relative{ + return &Relative{ Name{ map[string]interface{}{}, nil, diff --git a/node/nullable.go b/node/nullable.go index 6c61667..4786611 100644 --- a/node/nullable.go +++ b/node/nullable.go @@ -7,7 +7,7 @@ type Nullable struct { } func NewNullable(expression Node) Node { - return Nullable{ + return &Nullable{ map[string]interface{}{}, nil, expression, diff --git a/node/parameter.go b/node/parameter.go index 4ed4fd5..a746e31 100644 --- a/node/parameter.go +++ b/node/parameter.go @@ -9,7 +9,7 @@ type Parameter struct { } func NewParameter(variableType Node, variable Node, defaultValue Node, byRef bool, variadic bool) Node { - return Parameter{ + return &Parameter{ map[string]interface{}{ "byRef": byRef, "variadic": variadic, diff --git a/node/scalar/dnumber.go b/node/scalar/dnumber.go index fbd5bbb..9d46efb 100644 --- a/node/scalar/dnumber.go +++ b/node/scalar/dnumber.go @@ -10,7 +10,7 @@ type Dnumber struct { } func NewDnumber(value string) node.Node { - return Dnumber{ + return &Dnumber{ map[string]interface{}{ "value": value, }, diff --git a/node/scalar/encapsed.go b/node/scalar/encapsed.go index 7777ca8..82cb054 100644 --- a/node/scalar/encapsed.go +++ b/node/scalar/encapsed.go @@ -11,7 +11,7 @@ type Encapsed struct { } func NewEncapsed(parts []node.Node) node.Node { - return Encapsed{ + return &Encapsed{ map[string]interface{}{}, nil, parts, diff --git a/node/scalar/encapsed_string_part.go b/node/scalar/encapsed_string_part.go index a1dd025..2e68611 100644 --- a/node/scalar/encapsed_string_part.go +++ b/node/scalar/encapsed_string_part.go @@ -10,7 +10,7 @@ type EncapsedStringPart struct { } func NewEncapsedStringPart(value string) node.Node { - return EncapsedStringPart{ + return &EncapsedStringPart{ map[string]interface{}{ "value": value, }, diff --git a/node/scalar/lnumber.go b/node/scalar/lnumber.go index 04c685f..6b0b8db 100644 --- a/node/scalar/lnumber.go +++ b/node/scalar/lnumber.go @@ -10,7 +10,7 @@ type Lnumber struct { } func NewLnumber(value string) node.Node { - return Lnumber{ + return &Lnumber{ map[string]interface{}{ "value": value, }, diff --git a/node/scalar/magic_constant.go b/node/scalar/magic_constant.go index 53425f3..d82b643 100644 --- a/node/scalar/magic_constant.go +++ b/node/scalar/magic_constant.go @@ -10,7 +10,7 @@ type MagicConstant struct { } func NewMagicConstant(value string) node.Node { - return MagicConstant{ + return &MagicConstant{ map[string]interface{}{ "value": value, }, diff --git a/node/scalar/string.go b/node/scalar/string.go index 3231ea7..bdf3986 100644 --- a/node/scalar/string.go +++ b/node/scalar/string.go @@ -10,7 +10,7 @@ type String struct { } func NewString(value string) node.Node { - return String{ + return &String{ map[string]interface{}{ "value": value, }, diff --git a/node/stmt/alt_else.go b/node/stmt/alt_else.go index e693561..7ae992c 100644 --- a/node/stmt/alt_else.go +++ b/node/stmt/alt_else.go @@ -11,7 +11,7 @@ type AltElse struct { } func NewAltElse(stmt node.Node) node.Node { - return AltElse{ + return &AltElse{ map[string]interface{}{}, nil, stmt, diff --git a/node/stmt/alt_else_if.go b/node/stmt/alt_else_if.go index c31db31..b12c103 100644 --- a/node/stmt/alt_else_if.go +++ b/node/stmt/alt_else_if.go @@ -12,7 +12,7 @@ type AltElseIf struct { } func NewAltElseIf(cond node.Node, stmt node.Node) node.Node { - return AltElseIf{ + return &AltElseIf{ map[string]interface{}{}, nil, cond, diff --git a/node/stmt/alt_if.go b/node/stmt/alt_if.go index af1242e..a64945d 100644 --- a/node/stmt/alt_if.go +++ b/node/stmt/alt_if.go @@ -14,7 +14,7 @@ type AltIf struct { } func NewAltIf(cond node.Node, stmt node.Node) node.Node { - return AltIf{ + return &AltIf{ map[string]interface{}{}, nil, cond, diff --git a/node/stmt/break.go b/node/stmt/break.go index 404fc2d..8c925f1 100644 --- a/node/stmt/break.go +++ b/node/stmt/break.go @@ -11,7 +11,7 @@ type Break struct { } func NewBreak(expr node.Node) node.Node { - return Break{ + return &Break{ map[string]interface{}{}, nil, expr, diff --git a/node/stmt/case.go b/node/stmt/case.go index 75bd5a5..bd6772e 100644 --- a/node/stmt/case.go +++ b/node/stmt/case.go @@ -12,7 +12,7 @@ type Case struct { } func NewCase(cond node.Node, stmts []node.Node) node.Node { - return Case{ + return &Case{ map[string]interface{}{}, nil, cond, diff --git a/node/stmt/catch.go b/node/stmt/catch.go index 743efa7..f3bf60c 100644 --- a/node/stmt/catch.go +++ b/node/stmt/catch.go @@ -13,7 +13,7 @@ type Catch struct { } func NewCatch(types []node.Node, variable node.Node, stmts []node.Node) node.Node { - return Catch{ + return &Catch{ map[string]interface{}{}, nil, types, diff --git a/node/stmt/class.go b/node/stmt/class.go index 639e2ef..003fd0b 100644 --- a/node/stmt/class.go +++ b/node/stmt/class.go @@ -16,7 +16,7 @@ type Class struct { } func NewClass(className node.Node, modifiers []node.Node, args []node.Node, extends node.Node, implements []node.Node, stmts []node.Node, phpDocComment string) node.Node { - return Class{ + return &Class{ map[string]interface{}{ "phpDocComment": phpDocComment, }, diff --git a/node/stmt/class_const_list.go b/node/stmt/class_const_list.go index 7c1143c..9754da4 100644 --- a/node/stmt/class_const_list.go +++ b/node/stmt/class_const_list.go @@ -12,7 +12,7 @@ type ClassConstList struct { } func NewClassConstList(modifiers []node.Node, consts []node.Node) node.Node { - return ClassConstList{ + return &ClassConstList{ map[string]interface{}{}, nil, modifiers, diff --git a/node/stmt/class_method.go b/node/stmt/class_method.go index 17e83c5..5bc5d4c 100644 --- a/node/stmt/class_method.go +++ b/node/stmt/class_method.go @@ -15,7 +15,7 @@ type ClassMethod struct { } func NewClassMethod(methodName node.Node, modifiers []node.Node, returnsRef bool, params []node.Node, returnType node.Node, stmts []node.Node, phpDocComment string) node.Node { - return ClassMethod{ + return &ClassMethod{ map[string]interface{}{ "returnsRef": returnsRef, "phpDocComment": phpDocComment, diff --git a/node/stmt/const_list.go b/node/stmt/const_list.go index db4fe9a..56689f9 100644 --- a/node/stmt/const_list.go +++ b/node/stmt/const_list.go @@ -11,7 +11,7 @@ type ConstList struct { } func NewConstList(consts []node.Node) node.Node { - return ConstList{ + return &ConstList{ map[string]interface{}{}, nil, consts, diff --git a/node/stmt/constant.go b/node/stmt/constant.go index 820c685..0f45810 100644 --- a/node/stmt/constant.go +++ b/node/stmt/constant.go @@ -12,7 +12,7 @@ type Constant struct { } func NewConstant(constantName node.Node, expr node.Node, phpDocComment string) node.Node { - return Constant{ + return &Constant{ map[string]interface{}{ "phpDocComment": phpDocComment, }, diff --git a/node/stmt/continue.go b/node/stmt/continue.go index 88f94da..a738337 100644 --- a/node/stmt/continue.go +++ b/node/stmt/continue.go @@ -11,7 +11,7 @@ type Continue struct { } func NewContinue(expr node.Node) node.Node { - return Continue{ + return &Continue{ map[string]interface{}{}, nil, expr, diff --git a/node/stmt/declare.go b/node/stmt/declare.go index 98c584e..4a3e42c 100644 --- a/node/stmt/declare.go +++ b/node/stmt/declare.go @@ -12,7 +12,7 @@ type Declare struct { } func NewDeclare(consts []node.Node, stmt node.Node) node.Node { - return Declare{ + return &Declare{ map[string]interface{}{}, nil, consts, diff --git a/node/stmt/default.go b/node/stmt/default.go index 9100add..f4e4597 100644 --- a/node/stmt/default.go +++ b/node/stmt/default.go @@ -11,7 +11,7 @@ type Default struct { } func NewDefault(stmts []node.Node) node.Node { - return Default{ + return &Default{ map[string]interface{}{}, nil, stmts, diff --git a/node/stmt/do.go b/node/stmt/do.go index f1b2f6a..b0c9646 100644 --- a/node/stmt/do.go +++ b/node/stmt/do.go @@ -12,7 +12,7 @@ type Do struct { } func NewDo(stmt node.Node, cond node.Node) node.Node { - return Do{ + return &Do{ map[string]interface{}{}, nil, stmt, diff --git a/node/stmt/echo.go b/node/stmt/echo.go index 3faf9e5..2cc11f6 100644 --- a/node/stmt/echo.go +++ b/node/stmt/echo.go @@ -11,7 +11,7 @@ type Echo struct { } func NewEcho(exprs []node.Node) node.Node { - return Echo{ + return &Echo{ map[string]interface{}{}, nil, exprs, diff --git a/node/stmt/else.go b/node/stmt/else.go index 4efd80b..387d12b 100644 --- a/node/stmt/else.go +++ b/node/stmt/else.go @@ -11,7 +11,7 @@ type Else struct { } func NewElse(stmt node.Node) node.Node { - return Else{ + return &Else{ map[string]interface{}{}, nil, stmt, diff --git a/node/stmt/else_if.go b/node/stmt/else_if.go index 135363c..cc1c3e8 100644 --- a/node/stmt/else_if.go +++ b/node/stmt/else_if.go @@ -12,7 +12,7 @@ type ElseIf struct { } func NewElseIf(cond node.Node, stmt node.Node) node.Node { - return ElseIf{ + return &ElseIf{ map[string]interface{}{}, nil, cond, diff --git a/node/stmt/expression.go b/node/stmt/expression.go index f7e69a1..e9db12a 100644 --- a/node/stmt/expression.go +++ b/node/stmt/expression.go @@ -11,7 +11,7 @@ type Expression struct { } func NewExpression(expr node.Node) node.Node { - return Expression{ + return &Expression{ map[string]interface{}{}, nil, expr, diff --git a/node/stmt/finally.go b/node/stmt/finally.go index 25bb298..821a1c2 100644 --- a/node/stmt/finally.go +++ b/node/stmt/finally.go @@ -11,7 +11,7 @@ type Finally struct { } func NewFinally(stmts []node.Node) node.Node { - return Finally{ + return &Finally{ map[string]interface{}{}, nil, stmts, diff --git a/node/stmt/for.go b/node/stmt/for.go index 832d23f..3a7e6fe 100644 --- a/node/stmt/for.go +++ b/node/stmt/for.go @@ -14,7 +14,7 @@ type For struct { } func NewFor(init []node.Node, cond []node.Node, loop []node.Node, stmt node.Node) node.Node { - return For{ + return &For{ map[string]interface{}{}, nil, init, diff --git a/node/stmt/foreach.go b/node/stmt/foreach.go index 7dda65f..b5e9eff 100644 --- a/node/stmt/foreach.go +++ b/node/stmt/foreach.go @@ -14,7 +14,7 @@ type Foreach struct { } func NewForeach(expr node.Node, key node.Node, variable node.Node, stmt node.Node, byRef bool) node.Node { - return Foreach{ + return &Foreach{ map[string]interface{}{ "byRef": byRef, }, diff --git a/node/stmt/function.go b/node/stmt/function.go index c6d1b0f..ebd8fc0 100644 --- a/node/stmt/function.go +++ b/node/stmt/function.go @@ -14,7 +14,7 @@ type Function struct { } func NewFunction(functionName node.Node, returnsRef bool, params []node.Node, returnType node.Node, stmts []node.Node, phpDocComment string) node.Node { - return Function{ + return &Function{ map[string]interface{}{ "returnsRef": returnsRef, "phpDocComment": phpDocComment, diff --git a/node/stmt/global.go b/node/stmt/global.go index a22c606..5e89212 100644 --- a/node/stmt/global.go +++ b/node/stmt/global.go @@ -11,7 +11,7 @@ type Global struct { } func NewGlobal(vars []node.Node) node.Node { - return Global{ + return &Global{ map[string]interface{}{}, nil, vars, diff --git a/node/stmt/goto.go b/node/stmt/goto.go index 61dadb2..e99170c 100644 --- a/node/stmt/goto.go +++ b/node/stmt/goto.go @@ -11,7 +11,7 @@ type Goto struct { } func NewGoto(label node.Node) node.Node { - return Goto{ + return &Goto{ map[string]interface{}{}, nil, label, diff --git a/node/stmt/group_use.go b/node/stmt/group_use.go index 57dc840..f6a65a7 100644 --- a/node/stmt/group_use.go +++ b/node/stmt/group_use.go @@ -13,7 +13,7 @@ type GroupUse struct { } func NewGroupUse(useType node.Node, prefix node.Node, useList []node.Node) node.Node { - return GroupUse{ + return &GroupUse{ map[string]interface{}{}, nil, useType, diff --git a/node/stmt/halt_compiler.go b/node/stmt/halt_compiler.go index 2984d8f..4231847 100644 --- a/node/stmt/halt_compiler.go +++ b/node/stmt/halt_compiler.go @@ -10,7 +10,7 @@ type HaltCompiler struct { } func NewHaltCompiler() node.Node { - return HaltCompiler{ + return &HaltCompiler{ map[string]interface{}{}, nil, } diff --git a/node/stmt/if.go b/node/stmt/if.go index e3964cb..fa6d1b3 100644 --- a/node/stmt/if.go +++ b/node/stmt/if.go @@ -14,7 +14,7 @@ type If struct { } func NewIf(cond node.Node, stmt node.Node) node.Node { - return If{ + return &If{ map[string]interface{}{}, nil, cond, diff --git a/node/stmt/inline_html.go b/node/stmt/inline_html.go index 8a0cfab..a28d9b8 100644 --- a/node/stmt/inline_html.go +++ b/node/stmt/inline_html.go @@ -10,7 +10,7 @@ type InlineHtml struct { } func NewInlineHtml(value string) node.Node { - return InlineHtml{ + return &InlineHtml{ map[string]interface{}{ "value": value, }, diff --git a/node/stmt/interface.go b/node/stmt/interface.go index 1463eb3..31242ac 100644 --- a/node/stmt/interface.go +++ b/node/stmt/interface.go @@ -13,7 +13,7 @@ type Interface struct { } func NewInterface(interfaceName node.Node, extends []node.Node, stmts []node.Node, phpDocComment string) node.Node { - return Interface{ + return &Interface{ map[string]interface{}{ "phpDocComment": phpDocComment, }, diff --git a/node/stmt/label.go b/node/stmt/label.go index 23415ee..ce384af 100644 --- a/node/stmt/label.go +++ b/node/stmt/label.go @@ -11,7 +11,7 @@ type Label struct { } func NewLabel(labelName node.Node) node.Node { - return Label{ + return &Label{ map[string]interface{}{}, nil, labelName, diff --git a/node/stmt/namespace.go b/node/stmt/namespace.go index fc98132..d370e1e 100644 --- a/node/stmt/namespace.go +++ b/node/stmt/namespace.go @@ -12,7 +12,7 @@ type Namespace struct { } func NewNamespace(namespaceName node.Node, stmts []node.Node) node.Node { - return Namespace{ + return &Namespace{ map[string]interface{}{}, nil, namespaceName, diff --git a/node/stmt/nop.go b/node/stmt/nop.go index 981ea24..53df4f8 100644 --- a/node/stmt/nop.go +++ b/node/stmt/nop.go @@ -10,7 +10,7 @@ type Nop struct { } func NewNop() node.Node { - return Nop{ + return &Nop{ map[string]interface{}{}, nil, } diff --git a/node/stmt/property.go b/node/stmt/property.go index fdb22ba..fc889ab 100644 --- a/node/stmt/property.go +++ b/node/stmt/property.go @@ -12,7 +12,7 @@ type Property struct { } func NewProperty(variable node.Node, expr node.Node, phpDocComment string) node.Node { - return Property{ + return &Property{ map[string]interface{}{ "phpDocComment": phpDocComment, }, diff --git a/node/stmt/property_list.go b/node/stmt/property_list.go index 50a62a8..1d99f25 100644 --- a/node/stmt/property_list.go +++ b/node/stmt/property_list.go @@ -12,7 +12,7 @@ type PropertyList struct { } func NewPropertyList(modifiers []node.Node, properties []node.Node) node.Node { - return PropertyList{ + return &PropertyList{ map[string]interface{}{}, nil, modifiers, diff --git a/node/stmt/return.go b/node/stmt/return.go index 26eb2b8..eae30d0 100644 --- a/node/stmt/return.go +++ b/node/stmt/return.go @@ -11,7 +11,7 @@ type Return struct { } func NewReturn(expr node.Node) node.Node { - return Return{ + return &Return{ map[string]interface{}{}, nil, expr, diff --git a/node/stmt/static.go b/node/stmt/static.go index 121d72e..34eeff6 100644 --- a/node/stmt/static.go +++ b/node/stmt/static.go @@ -11,7 +11,7 @@ type Static struct { } func NewStatic(vars []node.Node) node.Node { - return Static{ + return &Static{ map[string]interface{}{}, nil, vars, diff --git a/node/stmt/static_var.go b/node/stmt/static_var.go index b8782b0..5256c91 100644 --- a/node/stmt/static_var.go +++ b/node/stmt/static_var.go @@ -12,7 +12,7 @@ type StaticVar struct { } func NewStaticVar(variable node.Node, expr node.Node) node.Node { - return StaticVar{ + return &StaticVar{ map[string]interface{}{}, nil, variable, diff --git a/node/stmt/stmt_list.go b/node/stmt/stmt_list.go index e70a2b8..a4b610b 100644 --- a/node/stmt/stmt_list.go +++ b/node/stmt/stmt_list.go @@ -11,7 +11,7 @@ type StmtList struct { } func NewStmtList(stmts []node.Node) node.Node { - return StmtList{ + return &StmtList{ map[string]interface{}{}, nil, stmts, diff --git a/node/stmt/switch.go b/node/stmt/switch.go index d1550c1..9c7072d 100644 --- a/node/stmt/switch.go +++ b/node/stmt/switch.go @@ -14,7 +14,7 @@ type Switch struct { } func NewSwitch(token token.Token, cond node.Node, cases []node.Node) node.Node { - return Switch{ + return &Switch{ map[string]interface{}{}, nil, token, diff --git a/node/stmt/throw.go b/node/stmt/throw.go index 1200a59..5c05b00 100644 --- a/node/stmt/throw.go +++ b/node/stmt/throw.go @@ -11,7 +11,7 @@ type Throw struct { } func NewThrow(expr node.Node) node.Node { - return Throw{ + return &Throw{ map[string]interface{}{}, nil, expr, diff --git a/node/stmt/trait.go b/node/stmt/trait.go index e42e877..5d9f8d8 100644 --- a/node/stmt/trait.go +++ b/node/stmt/trait.go @@ -12,7 +12,7 @@ type Trait struct { } func NewTrait(traitName node.Node, stmts []node.Node, phpDocComment string) node.Node { - return Trait{ + return &Trait{ map[string]interface{}{ "phpDocComment": phpDocComment, }, diff --git a/node/stmt/trait_method_ref.go b/node/stmt/trait_method_ref.go index ba27b1a..1d27953 100644 --- a/node/stmt/trait_method_ref.go +++ b/node/stmt/trait_method_ref.go @@ -12,7 +12,7 @@ type TraitMethodRef struct { } func NewTraitMethodRef(trait node.Node, method node.Node) node.Node { - return TraitMethodRef{ + return &TraitMethodRef{ map[string]interface{}{}, nil, trait, diff --git a/node/stmt/trait_use.go b/node/stmt/trait_use.go index 07821f8..25737fe 100644 --- a/node/stmt/trait_use.go +++ b/node/stmt/trait_use.go @@ -12,7 +12,7 @@ type TraitUse struct { } func NewTraitUse(traits []node.Node, adaptations []node.Node) node.Node { - return TraitUse{ + return &TraitUse{ map[string]interface{}{}, nil, traits, diff --git a/node/stmt/trait_use_alias.go b/node/stmt/trait_use_alias.go index b0aa2da..1bf3911 100644 --- a/node/stmt/trait_use_alias.go +++ b/node/stmt/trait_use_alias.go @@ -13,7 +13,7 @@ type TraitUseAlias struct { } func NewTraitUseAlias(ref node.Node, modifier node.Node, alias node.Node) node.Node { - return TraitUseAlias{ + return &TraitUseAlias{ map[string]interface{}{}, nil, ref, diff --git a/node/stmt/trait_use_precedence.go b/node/stmt/trait_use_precedence.go index d04cdc6..c321bf4 100644 --- a/node/stmt/trait_use_precedence.go +++ b/node/stmt/trait_use_precedence.go @@ -12,7 +12,7 @@ type TraitUsePrecedence struct { } func NewTraitUsePrecedence(ref node.Node, insteadof node.Node) node.Node { - return TraitUsePrecedence{ + return &TraitUsePrecedence{ map[string]interface{}{}, nil, ref, diff --git a/node/stmt/try.go b/node/stmt/try.go index f16e6b7..cd33188 100644 --- a/node/stmt/try.go +++ b/node/stmt/try.go @@ -13,7 +13,7 @@ type Try struct { } func NewTry(stmts []node.Node, catches []node.Node, finally node.Node) node.Node { - return Try{ + return &Try{ map[string]interface{}{}, nil, stmts, diff --git a/node/stmt/unset.go b/node/stmt/unset.go index d7fcadb..278b166 100644 --- a/node/stmt/unset.go +++ b/node/stmt/unset.go @@ -11,7 +11,7 @@ type Unset struct { } func NewUnset(vars []node.Node) node.Node { - return Unset{ + return &Unset{ map[string]interface{}{}, nil, vars, diff --git a/node/stmt/use.go b/node/stmt/use.go index 4f77a6a..d97e3f3 100644 --- a/node/stmt/use.go +++ b/node/stmt/use.go @@ -13,7 +13,7 @@ type Use struct { } func NewUse(useType node.Node, use node.Node, alias node.Node) node.Node { - return Use{ + return &Use{ map[string]interface{}{}, nil, useType, diff --git a/node/stmt/use_list.go b/node/stmt/use_list.go index 72e9f30..b8d8b5a 100644 --- a/node/stmt/use_list.go +++ b/node/stmt/use_list.go @@ -12,7 +12,7 @@ type UseList struct { } func NewUseList(useType node.Node, uses []node.Node) node.Node { - return UseList{ + return &UseList{ map[string]interface{}{}, nil, useType, diff --git a/node/stmt/while.go b/node/stmt/while.go index 312a831..874cdb7 100644 --- a/node/stmt/while.go +++ b/node/stmt/while.go @@ -14,7 +14,7 @@ type While struct { } func NewWhile(token token.Token, cond node.Node, stmt node.Node) node.Node { - return While{ + return &While{ map[string]interface{}{}, nil, token,