diff --git a/node/argument.go b/node/argument.go index 94b4377..b33613f 100644 --- a/node/argument.go +++ b/node/argument.go @@ -9,7 +9,7 @@ type Argument struct { Expr Node } -func NewArgument(Expression Node, Variadic bool) Node { +func NewArgument(Expression Node, Variadic bool) *Argument { return &Argument{ nil, nil, diff --git a/node/expr/array.go b/node/expr/array.go index 197feac..4fb012a 100644 --- a/node/expr/array.go +++ b/node/expr/array.go @@ -11,7 +11,7 @@ type Array struct { Items []node.Node } -func NewArray(Items []node.Node) node.Node { +func NewArray(Items []node.Node) *Array { return &Array{ nil, nil, diff --git a/node/expr/array_dim_fetch.go b/node/expr/array_dim_fetch.go index ed51d52..56b9290 100644 --- a/node/expr/array_dim_fetch.go +++ b/node/expr/array_dim_fetch.go @@ -12,7 +12,7 @@ type ArrayDimFetch struct { Dim node.Node } -func NewArrayDimFetch(Variable node.Node, Dim node.Node) node.Node { +func NewArrayDimFetch(Variable node.Node, Dim node.Node) *ArrayDimFetch { return &ArrayDimFetch{ nil, nil, diff --git a/node/expr/array_item.go b/node/expr/array_item.go index e7533fc..68c7d8c 100644 --- a/node/expr/array_item.go +++ b/node/expr/array_item.go @@ -13,7 +13,7 @@ type ArrayItem struct { Val node.Node } -func NewArrayItem(Key node.Node, Val node.Node, ByRef bool) node.Node { +func NewArrayItem(Key node.Node, Val node.Node, ByRef bool) *ArrayItem { return &ArrayItem{ nil, nil, diff --git a/node/expr/assign_op/assign.go b/node/expr/assign_op/assign.go index 9a0d476..22aa1a3 100644 --- a/node/expr/assign_op/assign.go +++ b/node/expr/assign_op/assign.go @@ -9,7 +9,7 @@ type Assign struct { AssignOp } -func NewAssign(Variable node.Node, Expression node.Node) node.Node { +func NewAssign(Variable node.Node, Expression node.Node) *Assign { return &Assign{ AssignOp{ nil, diff --git a/node/expr/assign_op/assign_ref.go b/node/expr/assign_op/assign_ref.go index 5ad5c5f..02a6491 100644 --- a/node/expr/assign_op/assign_ref.go +++ b/node/expr/assign_op/assign_ref.go @@ -9,7 +9,7 @@ type AssignRef struct { AssignOp } -func NewAssignRef(Variable node.Node, Expression node.Node) node.Node { +func NewAssignRef(Variable node.Node, Expression node.Node) *AssignRef { return &AssignRef{ AssignOp{ nil, diff --git a/node/expr/assign_op/bitwise_and.go b/node/expr/assign_op/bitwise_and.go index de63043..b72b51b 100644 --- a/node/expr/assign_op/bitwise_and.go +++ b/node/expr/assign_op/bitwise_and.go @@ -9,7 +9,7 @@ type BitwiseAnd struct { AssignOp } -func NewBitwiseAnd(Variable node.Node, Expression node.Node) node.Node { +func NewBitwiseAnd(Variable node.Node, Expression node.Node) *BitwiseAnd { return &BitwiseAnd{ AssignOp{ nil, diff --git a/node/expr/assign_op/bitwise_or.go b/node/expr/assign_op/bitwise_or.go index 3c1523b..25b8dab 100644 --- a/node/expr/assign_op/bitwise_or.go +++ b/node/expr/assign_op/bitwise_or.go @@ -9,7 +9,7 @@ type BitwiseOr struct { AssignOp } -func NewBitwiseOr(Variable node.Node, Expression node.Node) node.Node { +func NewBitwiseOr(Variable node.Node, Expression node.Node) *BitwiseOr { return &BitwiseOr{ AssignOp{ nil, diff --git a/node/expr/assign_op/bitwise_xor.go b/node/expr/assign_op/bitwise_xor.go index e378305..e0d1cc9 100644 --- a/node/expr/assign_op/bitwise_xor.go +++ b/node/expr/assign_op/bitwise_xor.go @@ -9,7 +9,7 @@ type BitwiseXor struct { AssignOp } -func NewBitwiseXor(Variable node.Node, Expression node.Node) node.Node { +func NewBitwiseXor(Variable node.Node, Expression node.Node) *BitwiseXor { return &BitwiseXor{ AssignOp{ nil, diff --git a/node/expr/assign_op/concat.go b/node/expr/assign_op/concat.go index f1e19e0..936a315 100644 --- a/node/expr/assign_op/concat.go +++ b/node/expr/assign_op/concat.go @@ -9,7 +9,7 @@ type Concat struct { AssignOp } -func NewConcat(Variable node.Node, Expression node.Node) node.Node { +func NewConcat(Variable node.Node, Expression node.Node) *Concat { return &Concat{ AssignOp{ nil, diff --git a/node/expr/assign_op/div.go b/node/expr/assign_op/div.go index fcc18c7..d93e277 100644 --- a/node/expr/assign_op/div.go +++ b/node/expr/assign_op/div.go @@ -9,7 +9,7 @@ type Div struct { AssignOp } -func NewDiv(Variable node.Node, Expression node.Node) node.Node { +func NewDiv(Variable node.Node, Expression node.Node) *Div { return &Div{ AssignOp{ nil, diff --git a/node/expr/assign_op/minus.go b/node/expr/assign_op/minus.go index de17c3a..72fdfab 100644 --- a/node/expr/assign_op/minus.go +++ b/node/expr/assign_op/minus.go @@ -9,7 +9,7 @@ type Minus struct { AssignOp } -func NewMinus(Variable node.Node, Expression node.Node) node.Node { +func NewMinus(Variable node.Node, Expression node.Node) *Minus { return &Minus{ AssignOp{ nil, diff --git a/node/expr/assign_op/mod.go b/node/expr/assign_op/mod.go index af24cf1..2f1c4af 100644 --- a/node/expr/assign_op/mod.go +++ b/node/expr/assign_op/mod.go @@ -9,7 +9,7 @@ type Mod struct { AssignOp } -func NewMod(Variable node.Node, Expression node.Node) node.Node { +func NewMod(Variable node.Node, Expression node.Node) *Mod { return &Mod{ AssignOp{ nil, diff --git a/node/expr/assign_op/mul.go b/node/expr/assign_op/mul.go index 4c5d205..8527f98 100644 --- a/node/expr/assign_op/mul.go +++ b/node/expr/assign_op/mul.go @@ -9,7 +9,7 @@ type Mul struct { AssignOp } -func NewMul(Variable node.Node, Expression node.Node) node.Node { +func NewMul(Variable node.Node, Expression node.Node) *Mul { return &Mul{ AssignOp{ nil, diff --git a/node/expr/assign_op/plus.go b/node/expr/assign_op/plus.go index 8d87d93..0e83294 100644 --- a/node/expr/assign_op/plus.go +++ b/node/expr/assign_op/plus.go @@ -9,7 +9,7 @@ type Plus struct { AssignOp } -func NewPlus(Variable node.Node, Expression node.Node) node.Node { +func NewPlus(Variable node.Node, Expression node.Node) *Plus { return &Plus{ AssignOp{ nil, diff --git a/node/expr/assign_op/pow.go b/node/expr/assign_op/pow.go index d984e82..d0c8800 100644 --- a/node/expr/assign_op/pow.go +++ b/node/expr/assign_op/pow.go @@ -9,7 +9,7 @@ type Pow struct { AssignOp } -func NewPow(Variable node.Node, Expression node.Node) node.Node { +func NewPow(Variable node.Node, Expression node.Node) *Pow { return &Pow{ AssignOp{ nil, diff --git a/node/expr/assign_op/shift_left.go b/node/expr/assign_op/shift_left.go index 52be668..4a121ef 100644 --- a/node/expr/assign_op/shift_left.go +++ b/node/expr/assign_op/shift_left.go @@ -9,7 +9,7 @@ type ShiftLeft struct { AssignOp } -func NewShiftLeft(Variable node.Node, Expression node.Node) node.Node { +func NewShiftLeft(Variable node.Node, Expression node.Node) *ShiftLeft { return &ShiftLeft{ AssignOp{ nil, diff --git a/node/expr/assign_op/shift_right.go b/node/expr/assign_op/shift_right.go index 8b1a08e..05d23a9 100644 --- a/node/expr/assign_op/shift_right.go +++ b/node/expr/assign_op/shift_right.go @@ -9,7 +9,7 @@ type ShiftRight struct { AssignOp } -func NewShiftRight(Variable node.Node, Expression node.Node) node.Node { +func NewShiftRight(Variable node.Node, Expression node.Node) *ShiftRight { return &ShiftRight{ AssignOp{ nil, diff --git a/node/expr/binary_op/bitwise_and.go b/node/expr/binary_op/bitwise_and.go index a7e887e..31299eb 100644 --- a/node/expr/binary_op/bitwise_and.go +++ b/node/expr/binary_op/bitwise_and.go @@ -9,7 +9,7 @@ type BitwiseAnd struct { BinaryOp } -func NewBitwiseAnd(Variable node.Node, Expression node.Node) node.Node { +func NewBitwiseAnd(Variable node.Node, Expression node.Node) *BitwiseAnd { return &BitwiseAnd{ BinaryOp{ nil, diff --git a/node/expr/binary_op/bitwise_or.go b/node/expr/binary_op/bitwise_or.go index f56134b..0f961a9 100644 --- a/node/expr/binary_op/bitwise_or.go +++ b/node/expr/binary_op/bitwise_or.go @@ -9,7 +9,7 @@ type BitwiseOr struct { BinaryOp } -func NewBitwiseOr(Variable node.Node, Expression node.Node) node.Node { +func NewBitwiseOr(Variable node.Node, Expression node.Node) *BitwiseOr { return &BitwiseOr{ BinaryOp{ nil, diff --git a/node/expr/binary_op/bitwise_xor.go b/node/expr/binary_op/bitwise_xor.go index 73c2957..0dcc01c 100644 --- a/node/expr/binary_op/bitwise_xor.go +++ b/node/expr/binary_op/bitwise_xor.go @@ -9,7 +9,7 @@ type BitwiseXor struct { BinaryOp } -func NewBitwiseXor(Variable node.Node, Expression node.Node) node.Node { +func NewBitwiseXor(Variable node.Node, Expression node.Node) *BitwiseXor { return &BitwiseXor{ BinaryOp{ nil, diff --git a/node/expr/binary_op/boolean_and.go b/node/expr/binary_op/boolean_and.go index ec3a809..2de26ba 100644 --- a/node/expr/binary_op/boolean_and.go +++ b/node/expr/binary_op/boolean_and.go @@ -9,7 +9,7 @@ type BooleanAnd struct { BinaryOp } -func NewBooleanAnd(Variable node.Node, Expression node.Node) node.Node { +func NewBooleanAnd(Variable node.Node, Expression node.Node) *BooleanAnd { return &BooleanAnd{ BinaryOp{ nil, diff --git a/node/expr/binary_op/boolean_or.go b/node/expr/binary_op/boolean_or.go index 8fa9d96..9e50d23 100644 --- a/node/expr/binary_op/boolean_or.go +++ b/node/expr/binary_op/boolean_or.go @@ -9,7 +9,7 @@ type BooleanOr struct { BinaryOp } -func NewBooleanOr(Variable node.Node, Expression node.Node) node.Node { +func NewBooleanOr(Variable node.Node, Expression node.Node) *BooleanOr { return &BooleanOr{ BinaryOp{ nil, diff --git a/node/expr/binary_op/coalesce.go b/node/expr/binary_op/coalesce.go index df4d0ed..a0e3b21 100644 --- a/node/expr/binary_op/coalesce.go +++ b/node/expr/binary_op/coalesce.go @@ -9,7 +9,7 @@ type Coalesce struct { BinaryOp } -func NewCoalesce(Variable node.Node, Expression node.Node) node.Node { +func NewCoalesce(Variable node.Node, Expression node.Node) *Coalesce { return &Coalesce{ BinaryOp{ nil, diff --git a/node/expr/binary_op/concat.go b/node/expr/binary_op/concat.go index 422f49c..03c4e56 100644 --- a/node/expr/binary_op/concat.go +++ b/node/expr/binary_op/concat.go @@ -9,7 +9,7 @@ type Concat struct { BinaryOp } -func NewConcat(Variable node.Node, Expression node.Node) node.Node { +func NewConcat(Variable node.Node, Expression node.Node) *Concat { return &Concat{ BinaryOp{ nil, diff --git a/node/expr/binary_op/div.go b/node/expr/binary_op/div.go index a7da01f..da07024 100644 --- a/node/expr/binary_op/div.go +++ b/node/expr/binary_op/div.go @@ -9,7 +9,7 @@ type Div struct { BinaryOp } -func NewDiv(Variable node.Node, Expression node.Node) node.Node { +func NewDiv(Variable node.Node, Expression node.Node) *Div { return &Div{ BinaryOp{ nil, diff --git a/node/expr/binary_op/equal.go b/node/expr/binary_op/equal.go index cdd7983..223987e 100644 --- a/node/expr/binary_op/equal.go +++ b/node/expr/binary_op/equal.go @@ -9,7 +9,7 @@ type Equal struct { BinaryOp } -func NewEqual(Variable node.Node, Expression node.Node) node.Node { +func NewEqual(Variable node.Node, Expression node.Node) *Equal { return &Equal{ BinaryOp{ nil, diff --git a/node/expr/binary_op/greater.go b/node/expr/binary_op/greater.go index 2544192..733eff7 100644 --- a/node/expr/binary_op/greater.go +++ b/node/expr/binary_op/greater.go @@ -9,7 +9,7 @@ type Greater struct { BinaryOp } -func NewGreater(Variable node.Node, Expression node.Node) node.Node { +func NewGreater(Variable node.Node, Expression node.Node) *Greater { return &Greater{ BinaryOp{ nil, diff --git a/node/expr/binary_op/greater_or_equal.go b/node/expr/binary_op/greater_or_equal.go index 04b8834..6a6f1d7 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 { BinaryOp } -func NewGreaterOrEqual(Variable node.Node, Expression node.Node) node.Node { +func NewGreaterOrEqual(Variable node.Node, Expression node.Node) *GreaterOrEqual { return &GreaterOrEqual{ BinaryOp{ nil, diff --git a/node/expr/binary_op/identical.go b/node/expr/binary_op/identical.go index 9f77a1e..9769518 100644 --- a/node/expr/binary_op/identical.go +++ b/node/expr/binary_op/identical.go @@ -9,7 +9,7 @@ type Identical struct { BinaryOp } -func NewIdentical(Variable node.Node, Expression node.Node) node.Node { +func NewIdentical(Variable node.Node, Expression node.Node) *Identical { return &Identical{ BinaryOp{ nil, diff --git a/node/expr/binary_op/logical_and.go b/node/expr/binary_op/logical_and.go index 4ffb950..de4af67 100644 --- a/node/expr/binary_op/logical_and.go +++ b/node/expr/binary_op/logical_and.go @@ -9,7 +9,7 @@ type LogicalAnd struct { BinaryOp } -func NewLogicalAnd(Variable node.Node, Expression node.Node) node.Node { +func NewLogicalAnd(Variable node.Node, Expression node.Node) *LogicalAnd { return &LogicalAnd{ BinaryOp{ nil, diff --git a/node/expr/binary_op/logical_or.go b/node/expr/binary_op/logical_or.go index 8407b5d..2e9311d 100644 --- a/node/expr/binary_op/logical_or.go +++ b/node/expr/binary_op/logical_or.go @@ -9,7 +9,7 @@ type LogicalOr struct { BinaryOp } -func NewLogicalOr(Variable node.Node, Expression node.Node) node.Node { +func NewLogicalOr(Variable node.Node, Expression node.Node) *LogicalOr { return &LogicalOr{ BinaryOp{ nil, diff --git a/node/expr/binary_op/logical_xor.go b/node/expr/binary_op/logical_xor.go index 72c6034..0bcbaa6 100644 --- a/node/expr/binary_op/logical_xor.go +++ b/node/expr/binary_op/logical_xor.go @@ -9,7 +9,7 @@ type LogicalXor struct { BinaryOp } -func NewLogicalXor(Variable node.Node, Expression node.Node) node.Node { +func NewLogicalXor(Variable node.Node, Expression node.Node) *LogicalXor { return &LogicalXor{ BinaryOp{ nil, diff --git a/node/expr/binary_op/minus.go b/node/expr/binary_op/minus.go index e6d6694..8ea6241 100644 --- a/node/expr/binary_op/minus.go +++ b/node/expr/binary_op/minus.go @@ -9,7 +9,7 @@ type Minus struct { BinaryOp } -func NewMinus(Variable node.Node, Expression node.Node) node.Node { +func NewMinus(Variable node.Node, Expression node.Node) *Minus { return &Minus{ BinaryOp{ nil, diff --git a/node/expr/binary_op/mod.go b/node/expr/binary_op/mod.go index 48ea0b5..9e591b1 100644 --- a/node/expr/binary_op/mod.go +++ b/node/expr/binary_op/mod.go @@ -9,7 +9,7 @@ type Mod struct { BinaryOp } -func NewMod(Variable node.Node, Expression node.Node) node.Node { +func NewMod(Variable node.Node, Expression node.Node) *Mod { return &Mod{ BinaryOp{ nil, diff --git a/node/expr/binary_op/mul.go b/node/expr/binary_op/mul.go index f47ec0a..0760067 100644 --- a/node/expr/binary_op/mul.go +++ b/node/expr/binary_op/mul.go @@ -9,7 +9,7 @@ type Mul struct { BinaryOp } -func NewMul(Variable node.Node, Expression node.Node) node.Node { +func NewMul(Variable node.Node, Expression node.Node) *Mul { return &Mul{ BinaryOp{ nil, diff --git a/node/expr/binary_op/not_equal.go b/node/expr/binary_op/not_equal.go index 979f3d8..0dfd2d3 100644 --- a/node/expr/binary_op/not_equal.go +++ b/node/expr/binary_op/not_equal.go @@ -9,7 +9,7 @@ type NotEqual struct { BinaryOp } -func NewNotEqual(Variable node.Node, Expression node.Node) node.Node { +func NewNotEqual(Variable node.Node, Expression node.Node) *NotEqual { return &NotEqual{ BinaryOp{ nil, diff --git a/node/expr/binary_op/not_identical.go b/node/expr/binary_op/not_identical.go index 6fc1a50..2881872 100644 --- a/node/expr/binary_op/not_identical.go +++ b/node/expr/binary_op/not_identical.go @@ -9,7 +9,7 @@ type NotIdentical struct { BinaryOp } -func NewNotIdentical(Variable node.Node, Expression node.Node) node.Node { +func NewNotIdentical(Variable node.Node, Expression node.Node) *NotIdentical { return &NotIdentical{ BinaryOp{ nil, diff --git a/node/expr/binary_op/plus.go b/node/expr/binary_op/plus.go index c20b206..bcc5acc 100644 --- a/node/expr/binary_op/plus.go +++ b/node/expr/binary_op/plus.go @@ -9,7 +9,7 @@ type Plus struct { BinaryOp } -func NewPlus(Variable node.Node, Expression node.Node) node.Node { +func NewPlus(Variable node.Node, Expression node.Node) *Plus { return &Plus{ BinaryOp{ nil, diff --git a/node/expr/binary_op/pow.go b/node/expr/binary_op/pow.go index 0d85662..5d7f485 100644 --- a/node/expr/binary_op/pow.go +++ b/node/expr/binary_op/pow.go @@ -9,7 +9,7 @@ type Pow struct { BinaryOp } -func NewPow(Variable node.Node, Expression node.Node) node.Node { +func NewPow(Variable node.Node, Expression node.Node) *Pow { return &Pow{ BinaryOp{ nil, diff --git a/node/expr/binary_op/shift_left.go b/node/expr/binary_op/shift_left.go index 2772926..5fd2205 100644 --- a/node/expr/binary_op/shift_left.go +++ b/node/expr/binary_op/shift_left.go @@ -9,7 +9,7 @@ type ShiftLeft struct { BinaryOp } -func NewShiftLeft(Variable node.Node, Expression node.Node) node.Node { +func NewShiftLeft(Variable node.Node, Expression node.Node) *ShiftLeft { return &ShiftLeft{ BinaryOp{ nil, diff --git a/node/expr/binary_op/shift_right.go b/node/expr/binary_op/shift_right.go index 1e5acb5..37febc9 100644 --- a/node/expr/binary_op/shift_right.go +++ b/node/expr/binary_op/shift_right.go @@ -9,7 +9,7 @@ type ShiftRight struct { BinaryOp } -func NewShiftRight(Variable node.Node, Expression node.Node) node.Node { +func NewShiftRight(Variable node.Node, Expression node.Node) *ShiftRight { return &ShiftRight{ BinaryOp{ nil, diff --git a/node/expr/binary_op/smaller.go b/node/expr/binary_op/smaller.go index 7438575..44aa053 100644 --- a/node/expr/binary_op/smaller.go +++ b/node/expr/binary_op/smaller.go @@ -9,7 +9,7 @@ type Smaller struct { BinaryOp } -func NewSmaller(Variable node.Node, Expression node.Node) node.Node { +func NewSmaller(Variable node.Node, Expression node.Node) *Smaller { return &Smaller{ BinaryOp{ nil, diff --git a/node/expr/binary_op/smaller_or_equal.go b/node/expr/binary_op/smaller_or_equal.go index 5d874a8..a9f0274 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 { BinaryOp } -func NewSmallerOrEqual(Variable node.Node, Expression node.Node) node.Node { +func NewSmallerOrEqual(Variable node.Node, Expression node.Node) *SmallerOrEqual { return &SmallerOrEqual{ BinaryOp{ nil, diff --git a/node/expr/binary_op/spaceship.go b/node/expr/binary_op/spaceship.go index 888d147..8d5120f 100644 --- a/node/expr/binary_op/spaceship.go +++ b/node/expr/binary_op/spaceship.go @@ -9,7 +9,7 @@ type Spaceship struct { BinaryOp } -func NewSpaceship(Variable node.Node, Expression node.Node) node.Node { +func NewSpaceship(Variable node.Node, Expression node.Node) *Spaceship { return &Spaceship{ BinaryOp{ nil, diff --git a/node/expr/bitwise_not.go b/node/expr/bitwise_not.go index 205fd1a..65b1673 100644 --- a/node/expr/bitwise_not.go +++ b/node/expr/bitwise_not.go @@ -11,7 +11,7 @@ type BitwiseNot struct { Expr node.Node } -func NewBitwiseNot(Expression node.Node) node.Node { +func NewBitwiseNot(Expression node.Node) *BitwiseNot { return &BitwiseNot{ nil, nil, diff --git a/node/expr/boolean_not.go b/node/expr/boolean_not.go index b7beb7e..4a7576d 100644 --- a/node/expr/boolean_not.go +++ b/node/expr/boolean_not.go @@ -11,7 +11,7 @@ type BooleanNot struct { Expr node.Node } -func NewBooleanNot(Expression node.Node) node.Node { +func NewBooleanNot(Expression node.Node) *BooleanNot { return &BooleanNot{ nil, nil, diff --git a/node/expr/cast/cast_array.go b/node/expr/cast/cast_array.go index 2403a1a..4741946 100644 --- a/node/expr/cast/cast_array.go +++ b/node/expr/cast/cast_array.go @@ -9,7 +9,7 @@ type CastArray struct { Cast } -func NewCastArray(Expr node.Node) node.Node { +func NewCastArray(Expr node.Node) *CastArray { return &CastArray{ Cast{ nil, diff --git a/node/expr/cast/cast_bool.go b/node/expr/cast/cast_bool.go index 583b839..eaed8c4 100644 --- a/node/expr/cast/cast_bool.go +++ b/node/expr/cast/cast_bool.go @@ -9,7 +9,7 @@ type CastBool struct { Cast } -func NewCastBool(Expr node.Node) node.Node { +func NewCastBool(Expr node.Node) *CastBool { return &CastBool{ Cast{ nil, diff --git a/node/expr/cast/cast_double.go b/node/expr/cast/cast_double.go index da06a18..34b19a0 100644 --- a/node/expr/cast/cast_double.go +++ b/node/expr/cast/cast_double.go @@ -9,7 +9,7 @@ type CastDouble struct { Cast } -func NewCastDouble(Expr node.Node) node.Node { +func NewCastDouble(Expr node.Node) *CastDouble { return &CastDouble{ Cast{ nil, diff --git a/node/expr/cast/cast_int.go b/node/expr/cast/cast_int.go index 44e57c1..d7aada8 100644 --- a/node/expr/cast/cast_int.go +++ b/node/expr/cast/cast_int.go @@ -9,7 +9,7 @@ type CastInt struct { Cast } -func NewCastInt(Expr node.Node) node.Node { +func NewCastInt(Expr node.Node) *CastInt { return &CastInt{ Cast{ nil, diff --git a/node/expr/cast/cast_object.go b/node/expr/cast/cast_object.go index 8c4079b..9e03373 100644 --- a/node/expr/cast/cast_object.go +++ b/node/expr/cast/cast_object.go @@ -9,7 +9,7 @@ type CastObject struct { Cast } -func NewCastObject(Expr node.Node) node.Node { +func NewCastObject(Expr node.Node) *CastObject { return &CastObject{ Cast{ nil, diff --git a/node/expr/cast/cast_string.go b/node/expr/cast/cast_string.go index 1057678..5ae3b53 100644 --- a/node/expr/cast/cast_string.go +++ b/node/expr/cast/cast_string.go @@ -9,7 +9,7 @@ type CastString struct { Cast } -func NewCastString(Expr node.Node) node.Node { +func NewCastString(Expr node.Node) *CastString { return &CastString{ Cast{ nil, diff --git a/node/expr/cast/cast_unset.go b/node/expr/cast/cast_unset.go index b97c867..4c15130 100644 --- a/node/expr/cast/cast_unset.go +++ b/node/expr/cast/cast_unset.go @@ -9,7 +9,7 @@ type CastUnset struct { Cast } -func NewCastUnset(Expr node.Node) node.Node { +func NewCastUnset(Expr node.Node) *CastUnset { return &CastUnset{ Cast{ nil, diff --git a/node/expr/class_const_fetch.go b/node/expr/class_const_fetch.go index a0e0fa4..4826fc5 100644 --- a/node/expr/class_const_fetch.go +++ b/node/expr/class_const_fetch.go @@ -12,7 +12,7 @@ type ClassConstFetch struct { ConstantName node.Node } -func NewClassConstFetch(Class node.Node, ConstantName node.Node) node.Node { +func NewClassConstFetch(Class node.Node, ConstantName node.Node) *ClassConstFetch { return &ClassConstFetch{ nil, nil, diff --git a/node/expr/clone.go b/node/expr/clone.go index 40baff3..8d81f9a 100644 --- a/node/expr/clone.go +++ b/node/expr/clone.go @@ -11,7 +11,7 @@ type Clone struct { Expr node.Node } -func NewClone(Expression node.Node) node.Node { +func NewClone(Expression node.Node) *Clone { return &Clone{ nil, nil, diff --git a/node/expr/closure.go b/node/expr/closure.go index d1a665f..1f6ff94 100644 --- a/node/expr/closure.go +++ b/node/expr/closure.go @@ -17,7 +17,7 @@ type Closure struct { Stmts []node.Node } -func NewClosure(Params []node.Node, Uses []node.Node, ReturnType node.Node, Stmts []node.Node, Static bool, ReturnsRef bool, PhpDocComment string) node.Node { +func NewClosure(Params []node.Node, Uses []node.Node, ReturnType node.Node, Stmts []node.Node, Static bool, ReturnsRef bool, PhpDocComment string) *Closure { return &Closure{ nil, nil, diff --git a/node/expr/closure_use.go b/node/expr/closure_use.go index eb7662a..33124cb 100644 --- a/node/expr/closure_use.go +++ b/node/expr/closure_use.go @@ -12,7 +12,7 @@ type ClusureUse struct { Variable node.Node } -func NewClusureUse(Variable node.Node, ByRef bool) node.Node { +func NewClusureUse(Variable node.Node, ByRef bool) *ClusureUse { return &ClusureUse{ nil, nil, diff --git a/node/expr/const_fetch.go b/node/expr/const_fetch.go index 50347f8..46842e0 100644 --- a/node/expr/const_fetch.go +++ b/node/expr/const_fetch.go @@ -11,7 +11,7 @@ type ConstFetch struct { Constant node.Node } -func NewConstFetch(Constant node.Node) node.Node { +func NewConstFetch(Constant node.Node) *ConstFetch { return &ConstFetch{ nil, nil, diff --git a/node/expr/empty.go b/node/expr/empty.go index a323e06..e83d2e3 100644 --- a/node/expr/empty.go +++ b/node/expr/empty.go @@ -11,7 +11,7 @@ type Empty struct { Expr node.Node } -func NewEmpty(Expression node.Node) node.Node { +func NewEmpty(Expression node.Node) *Empty { return &Empty{ nil, nil, diff --git a/node/expr/error_suppress.go b/node/expr/error_suppress.go index aea40b9..a5c601b 100644 --- a/node/expr/error_suppress.go +++ b/node/expr/error_suppress.go @@ -11,7 +11,7 @@ type ErrorSuppress struct { Expr node.Node } -func NewErrorSuppress(Expression node.Node) node.Node { +func NewErrorSuppress(Expression node.Node) *ErrorSuppress { return &ErrorSuppress{ nil, nil, diff --git a/node/expr/eval.go b/node/expr/eval.go index 664ea32..69c6c47 100644 --- a/node/expr/eval.go +++ b/node/expr/eval.go @@ -11,7 +11,7 @@ type Eval struct { Expr node.Node } -func NewEval(Expression node.Node) node.Node { +func NewEval(Expression node.Node) *Eval { return &Eval{ nil, nil, diff --git a/node/expr/exit.go b/node/expr/exit.go index 3770d97..ea487e9 100644 --- a/node/expr/exit.go +++ b/node/expr/exit.go @@ -12,7 +12,7 @@ type Exit struct { IsDie bool } -func NewExit(Expr node.Node, IsDie bool) node.Node { +func NewExit(Expr node.Node, IsDie bool) *Exit { return &Exit{ nil, nil, diff --git a/node/expr/function_call.go b/node/expr/function_call.go index e36f879..5f7e824 100644 --- a/node/expr/function_call.go +++ b/node/expr/function_call.go @@ -12,7 +12,7 @@ type FunctionCall struct { Arguments []node.Node } -func NewFunctionCall(Function node.Node, Arguments []node.Node) node.Node { +func NewFunctionCall(Function node.Node, Arguments []node.Node) *FunctionCall { return &FunctionCall{ nil, nil, diff --git a/node/expr/include.go b/node/expr/include.go index 3860a99..adfcdf5 100644 --- a/node/expr/include.go +++ b/node/expr/include.go @@ -11,7 +11,7 @@ type Include struct { Expr node.Node } -func NewInclude(Expression node.Node) node.Node { +func NewInclude(Expression node.Node) *Include { return &Include{ nil, nil, diff --git a/node/expr/include_once.go b/node/expr/include_once.go index c9accd7..a384d01 100644 --- a/node/expr/include_once.go +++ b/node/expr/include_once.go @@ -11,7 +11,7 @@ type IncludeOnce struct { Expr node.Node } -func NewIncludeOnce(Expression node.Node) node.Node { +func NewIncludeOnce(Expression node.Node) *IncludeOnce { return &IncludeOnce{ nil, nil, diff --git a/node/expr/instance_of.go b/node/expr/instance_of.go index b9ecd86..f135cbc 100644 --- a/node/expr/instance_of.go +++ b/node/expr/instance_of.go @@ -12,7 +12,7 @@ type InstanceOf struct { Class node.Node } -func NewInstanceOf(Expr node.Node, Class node.Node) node.Node { +func NewInstanceOf(Expr node.Node, Class node.Node) *InstanceOf { return &InstanceOf{ nil, nil, diff --git a/node/expr/isset.go b/node/expr/isset.go index 125372b..81d5b75 100644 --- a/node/expr/isset.go +++ b/node/expr/isset.go @@ -11,7 +11,7 @@ type Isset struct { Variables []node.Node } -func NewIsset(Variables []node.Node) node.Node { +func NewIsset(Variables []node.Node) *Isset { return &Isset{ nil, nil, diff --git a/node/expr/list.go b/node/expr/list.go index 860a6a4..28a439f 100644 --- a/node/expr/list.go +++ b/node/expr/list.go @@ -11,7 +11,7 @@ type List struct { Items []node.Node } -func NewList(Items []node.Node) node.Node { +func NewList(Items []node.Node) *List { return &List{ nil, nil, diff --git a/node/expr/method_call.go b/node/expr/method_call.go index a5669b5..cfb6a8d 100644 --- a/node/expr/method_call.go +++ b/node/expr/method_call.go @@ -13,7 +13,7 @@ type MethodCall struct { Arguments []node.Node } -func NewMethodCall(Variable node.Node, Method node.Node, Arguments []node.Node) node.Node { +func NewMethodCall(Variable node.Node, Method node.Node, Arguments []node.Node) *MethodCall { return &MethodCall{ nil, nil, diff --git a/node/expr/new.go b/node/expr/new.go index 5404043..c318d47 100644 --- a/node/expr/new.go +++ b/node/expr/new.go @@ -12,7 +12,7 @@ type New struct { Arguments []node.Node } -func NewNew(Class node.Node, Arguments []node.Node) node.Node { +func NewNew(Class node.Node, Arguments []node.Node) *New { return &New{ nil, nil, diff --git a/node/expr/post_dec.go b/node/expr/post_dec.go index a231c67..ee12def 100644 --- a/node/expr/post_dec.go +++ b/node/expr/post_dec.go @@ -11,7 +11,7 @@ type PostDec struct { Variable node.Node } -func NewPostDec(Variable node.Node) node.Node { +func NewPostDec(Variable node.Node) *PostDec { return &PostDec{ nil, nil, diff --git a/node/expr/post_inc.go b/node/expr/post_inc.go index 6503bfc..cd48647 100644 --- a/node/expr/post_inc.go +++ b/node/expr/post_inc.go @@ -11,7 +11,7 @@ type PostInc struct { Variable node.Node } -func NewPostInc(Variable node.Node) node.Node { +func NewPostInc(Variable node.Node) *PostInc { return &PostInc{ nil, nil, diff --git a/node/expr/pre_dec.go b/node/expr/pre_dec.go index 8991bc1..4d044e8 100644 --- a/node/expr/pre_dec.go +++ b/node/expr/pre_dec.go @@ -11,7 +11,7 @@ type PreDec struct { Variable node.Node } -func NewPreDec(Variable node.Node) node.Node { +func NewPreDec(Variable node.Node) *PreDec { return &PreDec{ nil, nil, diff --git a/node/expr/pre_inc.go b/node/expr/pre_inc.go index 2b117a5..505725e 100644 --- a/node/expr/pre_inc.go +++ b/node/expr/pre_inc.go @@ -11,7 +11,7 @@ type PreInc struct { Variable node.Node } -func NewPreInc(Variable node.Node) node.Node { +func NewPreInc(Variable node.Node) *PreInc { return &PreInc{ nil, nil, diff --git a/node/expr/print.go b/node/expr/print.go index 0867b9b..91b6542 100644 --- a/node/expr/print.go +++ b/node/expr/print.go @@ -11,7 +11,7 @@ type Print struct { Expr node.Node } -func NewPrint(Expression node.Node) node.Node { +func NewPrint(Expression node.Node) *Print { return &Print{ nil, nil, diff --git a/node/expr/property_fetch.go b/node/expr/property_fetch.go index e5701d3..7705558 100644 --- a/node/expr/property_fetch.go +++ b/node/expr/property_fetch.go @@ -12,7 +12,7 @@ type PropertyFetch struct { Property node.Node } -func NewPropertyFetch(Variable node.Node, Property node.Node) node.Node { +func NewPropertyFetch(Variable node.Node, Property node.Node) *PropertyFetch { return &PropertyFetch{ nil, nil, diff --git a/node/expr/require.go b/node/expr/require.go index 66a7bc9..8b662b6 100644 --- a/node/expr/require.go +++ b/node/expr/require.go @@ -11,7 +11,7 @@ type Require struct { Expr node.Node } -func NewRequire(Expression node.Node) node.Node { +func NewRequire(Expression node.Node) *Require { return &Require{ nil, nil, diff --git a/node/expr/require_once.go b/node/expr/require_once.go index e4886c8..f5dfb9e 100644 --- a/node/expr/require_once.go +++ b/node/expr/require_once.go @@ -11,7 +11,7 @@ type RequireOnce struct { Expr node.Node } -func NewRequireOnce(Expression node.Node) node.Node { +func NewRequireOnce(Expression node.Node) *RequireOnce { return &RequireOnce{ nil, nil, diff --git a/node/expr/shell_exec.go b/node/expr/shell_exec.go index 25fd0ae..bf6df24 100644 --- a/node/expr/shell_exec.go +++ b/node/expr/shell_exec.go @@ -11,7 +11,7 @@ type ShellExec struct { Parts []node.Node } -func NewShellExec(Parts []node.Node) node.Node { +func NewShellExec(Parts []node.Node) *ShellExec { return &ShellExec{ nil, nil, diff --git a/node/expr/short_array.go b/node/expr/short_array.go index e959a87..43574d0 100644 --- a/node/expr/short_array.go +++ b/node/expr/short_array.go @@ -11,7 +11,7 @@ type ShortArray struct { Items []node.Node } -func NewShortArray(Items []node.Node) node.Node { +func NewShortArray(Items []node.Node) *ShortArray { return &ShortArray{ nil, nil, diff --git a/node/expr/short_list.go b/node/expr/short_list.go index b5c53b5..95484bf 100644 --- a/node/expr/short_list.go +++ b/node/expr/short_list.go @@ -11,7 +11,7 @@ type ShortList struct { Items []node.Node } -func NewShortList(Items []node.Node) node.Node { +func NewShortList(Items []node.Node) *ShortList { return &ShortList{ nil, nil, diff --git a/node/expr/static_call.go b/node/expr/static_call.go index 009c7a5..13ea6a9 100644 --- a/node/expr/static_call.go +++ b/node/expr/static_call.go @@ -13,7 +13,7 @@ type StaticCall struct { Arguments []node.Node } -func NewStaticCall(Class node.Node, Call node.Node, Arguments []node.Node) node.Node { +func NewStaticCall(Class node.Node, Call node.Node, Arguments []node.Node) *StaticCall { return &StaticCall{ nil, nil, diff --git a/node/expr/static_property_fetch.go b/node/expr/static_property_fetch.go index 0bce323..5f460a1 100644 --- a/node/expr/static_property_fetch.go +++ b/node/expr/static_property_fetch.go @@ -12,7 +12,7 @@ type StaticPropertyFetch struct { Property node.Node } -func NewStaticPropertyFetch(Class node.Node, Property node.Node) node.Node { +func NewStaticPropertyFetch(Class node.Node, Property node.Node) *StaticPropertyFetch { return &StaticPropertyFetch{ nil, nil, diff --git a/node/expr/ternary.go b/node/expr/ternary.go index 739f375..8c6b96e 100644 --- a/node/expr/ternary.go +++ b/node/expr/ternary.go @@ -13,7 +13,7 @@ type Ternary struct { IfFalse node.Node } -func NewTernary(Condition node.Node, IfTrue node.Node, IfFalse node.Node) node.Node { +func NewTernary(Condition node.Node, IfTrue node.Node, IfFalse node.Node) *Ternary { return &Ternary{ nil, nil, diff --git a/node/expr/unary_minus.go b/node/expr/unary_minus.go index c3e8c87..085a83f 100644 --- a/node/expr/unary_minus.go +++ b/node/expr/unary_minus.go @@ -11,7 +11,7 @@ type UnaryMinus struct { Expr node.Node } -func NewUnaryMinus(Expression node.Node) node.Node { +func NewUnaryMinus(Expression node.Node) *UnaryMinus { return &UnaryMinus{ nil, nil, diff --git a/node/expr/unary_plus.go b/node/expr/unary_plus.go index 921b48e..55727f2 100644 --- a/node/expr/unary_plus.go +++ b/node/expr/unary_plus.go @@ -11,7 +11,7 @@ type UnaryPlus struct { Expr node.Node } -func NewUnaryPlus(Expression node.Node) node.Node { +func NewUnaryPlus(Expression node.Node) *UnaryPlus { return &UnaryPlus{ nil, nil, diff --git a/node/expr/variable.go b/node/expr/variable.go index b54799b..6301e09 100644 --- a/node/expr/variable.go +++ b/node/expr/variable.go @@ -11,7 +11,7 @@ type Variable struct { VarName node.Node } -func NewVariable(VarName node.Node) node.Node { +func NewVariable(VarName node.Node) *Variable { return &Variable{ nil, nil, diff --git a/node/expr/yield.go b/node/expr/yield.go index add0f4d..2acdb62 100644 --- a/node/expr/yield.go +++ b/node/expr/yield.go @@ -12,7 +12,7 @@ type Yield struct { Value node.Node } -func NewYield(Key node.Node, Value node.Node) node.Node { +func NewYield(Key node.Node, Value node.Node) *Yield { return &Yield{ nil, nil, diff --git a/node/expr/yield_from.go b/node/expr/yield_from.go index 19efee7..b4a905b 100644 --- a/node/expr/yield_from.go +++ b/node/expr/yield_from.go @@ -11,7 +11,7 @@ type YieldFrom struct { Expr node.Node } -func NewYieldFrom(Expression node.Node) node.Node { +func NewYieldFrom(Expression node.Node) *YieldFrom { return &YieldFrom{ nil, nil, diff --git a/node/identifier.go b/node/identifier.go index 533e74d..d807fc3 100644 --- a/node/identifier.go +++ b/node/identifier.go @@ -8,7 +8,7 @@ type Identifier struct { Value string } -func NewIdentifier(Value string) Node { +func NewIdentifier(Value string) *Identifier { return &Identifier{ nil, nil, diff --git a/node/name/fully_qualified.go b/node/name/fully_qualified.go index b12a479..1eddde1 100644 --- a/node/name/fully_qualified.go +++ b/node/name/fully_qualified.go @@ -8,7 +8,7 @@ type FullyQualified struct { Name } -func NewFullyQualified(Parts []node.Node) node.Node { +func NewFullyQualified(Parts []node.Node) *FullyQualified { return &FullyQualified{ Name{ nil, diff --git a/node/name/name.go b/node/name/name.go index 3c8d5b2..db7a2cc 100644 --- a/node/name/name.go +++ b/node/name/name.go @@ -11,7 +11,7 @@ type Name struct { Parts []node.Node } -func NewName(Parts []node.Node) node.Node { +func NewName(Parts []node.Node) *Name { return &Name{ nil, nil, diff --git a/node/name/name_part.go b/node/name/name_part.go index 9ce00c9..e2f481b 100644 --- a/node/name/name_part.go +++ b/node/name/name_part.go @@ -11,7 +11,7 @@ type NamePart struct { Value string } -func NewNamePart(Value string) node.Node { +func NewNamePart(Value string) *NamePart { return &NamePart{ nil, nil, diff --git a/node/name/relative.go b/node/name/relative.go index 72d50c4..720307d 100644 --- a/node/name/relative.go +++ b/node/name/relative.go @@ -8,7 +8,7 @@ type Relative struct { Name } -func NewRelative(Parts []node.Node) node.Node { +func NewRelative(Parts []node.Node) *Relative { return &Relative{ Name{ nil, diff --git a/node/nullable.go b/node/nullable.go index 7dc8355..c1eccf4 100644 --- a/node/nullable.go +++ b/node/nullable.go @@ -8,7 +8,7 @@ type Nullable struct { Expr Node } -func NewNullable(Expression Node) Node { +func NewNullable(Expression Node) *Nullable { return &Nullable{ nil, nil, diff --git a/node/parameter.go b/node/parameter.go index 65cfe0e..f40922d 100644 --- a/node/parameter.go +++ b/node/parameter.go @@ -12,7 +12,7 @@ type Parameter struct { DefaultValue Node } -func NewParameter(VariableType Node, Variable Node, DefaultValue Node, ByRef bool, Variadic bool) Node { +func NewParameter(VariableType Node, Variable Node, DefaultValue Node, ByRef bool, Variadic bool) *Parameter { return &Parameter{ nil, nil, diff --git a/node/scalar/dnumber.go b/node/scalar/dnumber.go index b2696cd..8753126 100644 --- a/node/scalar/dnumber.go +++ b/node/scalar/dnumber.go @@ -11,7 +11,7 @@ type Dnumber struct { Value string } -func NewDnumber(Value string) node.Node { +func NewDnumber(Value string) *Dnumber { return &Dnumber{ nil, nil, diff --git a/node/scalar/encapsed.go b/node/scalar/encapsed.go index 693f195..b6ab72d 100644 --- a/node/scalar/encapsed.go +++ b/node/scalar/encapsed.go @@ -11,7 +11,7 @@ type Encapsed struct { Parts []node.Node } -func NewEncapsed(Parts []node.Node) node.Node { +func NewEncapsed(Parts []node.Node) *Encapsed { return &Encapsed{ nil, nil, diff --git a/node/scalar/encapsed_string_part.go b/node/scalar/encapsed_string_part.go index c17af13..8bd6d37 100644 --- a/node/scalar/encapsed_string_part.go +++ b/node/scalar/encapsed_string_part.go @@ -11,7 +11,7 @@ type EncapsedStringPart struct { Value string } -func NewEncapsedStringPart(Value string) node.Node { +func NewEncapsedStringPart(Value string) *EncapsedStringPart { return &EncapsedStringPart{ nil, nil, diff --git a/node/scalar/lnumber.go b/node/scalar/lnumber.go index cdd06f3..1de4632 100644 --- a/node/scalar/lnumber.go +++ b/node/scalar/lnumber.go @@ -11,7 +11,7 @@ type Lnumber struct { Value string } -func NewLnumber(Value string) node.Node { +func NewLnumber(Value string) *Lnumber { return &Lnumber{ nil, nil, diff --git a/node/scalar/magic_constant.go b/node/scalar/magic_constant.go index a9d1671..cb9b813 100644 --- a/node/scalar/magic_constant.go +++ b/node/scalar/magic_constant.go @@ -11,7 +11,7 @@ type MagicConstant struct { Value string } -func NewMagicConstant(Value string) node.Node { +func NewMagicConstant(Value string) *MagicConstant { return &MagicConstant{ nil, nil, diff --git a/node/scalar/string.go b/node/scalar/string.go index 79dff54..f2facea 100644 --- a/node/scalar/string.go +++ b/node/scalar/string.go @@ -11,7 +11,7 @@ type String struct { Value string } -func NewString(Value string) node.Node { +func NewString(Value string) *String { return &String{ nil, nil, diff --git a/node/stmt/alt_else.go b/node/stmt/alt_else.go index a3b390d..cc9515f 100644 --- a/node/stmt/alt_else.go +++ b/node/stmt/alt_else.go @@ -11,7 +11,7 @@ type AltElse struct { Stmt node.Node } -func NewAltElse(Stmt node.Node) node.Node { +func NewAltElse(Stmt node.Node) *AltElse { return &AltElse{ nil, nil, diff --git a/node/stmt/alt_else_if.go b/node/stmt/alt_else_if.go index b516b26..521590e 100644 --- a/node/stmt/alt_else_if.go +++ b/node/stmt/alt_else_if.go @@ -12,7 +12,7 @@ type AltElseIf struct { Stmt node.Node } -func NewAltElseIf(Cond node.Node, Stmt node.Node) node.Node { +func NewAltElseIf(Cond node.Node, Stmt node.Node) *AltElseIf { return &AltElseIf{ nil, nil, diff --git a/node/stmt/alt_if.go b/node/stmt/alt_if.go index 55604ad..18b8c7e 100644 --- a/node/stmt/alt_if.go +++ b/node/stmt/alt_if.go @@ -14,7 +14,7 @@ type AltIf struct { _else node.Node } -func NewAltIf(Cond node.Node, Stmt node.Node) node.Node { +func NewAltIf(Cond node.Node, Stmt node.Node) *AltIf { return &AltIf{ nil, nil, diff --git a/node/stmt/break.go b/node/stmt/break.go index 9313dfb..1a32ebc 100644 --- a/node/stmt/break.go +++ b/node/stmt/break.go @@ -11,7 +11,7 @@ type Break struct { Expr node.Node } -func NewBreak(Expr node.Node) node.Node { +func NewBreak(Expr node.Node) *Break { return &Break{ nil, nil, diff --git a/node/stmt/case.go b/node/stmt/case.go index 0dcfe77..abae93d 100644 --- a/node/stmt/case.go +++ b/node/stmt/case.go @@ -12,7 +12,7 @@ type Case struct { Stmts []node.Node } -func NewCase(Cond node.Node, Stmts []node.Node) node.Node { +func NewCase(Cond node.Node, Stmts []node.Node) *Case { return &Case{ nil, nil, diff --git a/node/stmt/catch.go b/node/stmt/catch.go index cfe5e5e..527a737 100644 --- a/node/stmt/catch.go +++ b/node/stmt/catch.go @@ -13,7 +13,7 @@ type Catch struct { Stmts []node.Node } -func NewCatch(Types []node.Node, Variable node.Node, Stmts []node.Node) node.Node { +func NewCatch(Types []node.Node, Variable node.Node, Stmts []node.Node) *Catch { return &Catch{ nil, nil, diff --git a/node/stmt/class.go b/node/stmt/class.go index 1fafb67..28ddd18 100644 --- a/node/stmt/class.go +++ b/node/stmt/class.go @@ -17,7 +17,7 @@ type Class struct { Stmts []node.Node } -func NewClass(ClassName node.Node, Modifiers []node.Node, args []node.Node, Extends node.Node, Implements []node.Node, Stmts []node.Node, PhpDocComment string) node.Node { +func NewClass(ClassName node.Node, Modifiers []node.Node, args []node.Node, Extends node.Node, Implements []node.Node, Stmts []node.Node, PhpDocComment string) *Class { return &Class{ nil, nil, diff --git a/node/stmt/class_const_list.go b/node/stmt/class_const_list.go index faa3aef..8be4d74 100644 --- a/node/stmt/class_const_list.go +++ b/node/stmt/class_const_list.go @@ -12,7 +12,7 @@ type ClassConstList struct { Consts []node.Node } -func NewClassConstList(Modifiers []node.Node, Consts []node.Node) node.Node { +func NewClassConstList(Modifiers []node.Node, Consts []node.Node) *ClassConstList { return &ClassConstList{ nil, nil, diff --git a/node/stmt/class_method.go b/node/stmt/class_method.go index a48b43e..ed38667 100644 --- a/node/stmt/class_method.go +++ b/node/stmt/class_method.go @@ -17,7 +17,7 @@ type ClassMethod struct { Stmts []node.Node } -func NewClassMethod(MethodName node.Node, Modifiers []node.Node, ReturnsRef bool, Params []node.Node, ReturnType node.Node, Stmts []node.Node, PhpDocComment string) node.Node { +func NewClassMethod(MethodName node.Node, Modifiers []node.Node, ReturnsRef bool, Params []node.Node, ReturnType node.Node, Stmts []node.Node, PhpDocComment string) *ClassMethod { return &ClassMethod{ nil, nil, diff --git a/node/stmt/const_list.go b/node/stmt/const_list.go index 61144ab..6e50e9f 100644 --- a/node/stmt/const_list.go +++ b/node/stmt/const_list.go @@ -11,7 +11,7 @@ type ConstList struct { Consts []node.Node } -func NewConstList(Consts []node.Node) node.Node { +func NewConstList(Consts []node.Node) *ConstList { return &ConstList{ nil, nil, diff --git a/node/stmt/constant.go b/node/stmt/constant.go index 77cdb61..8780f39 100644 --- a/node/stmt/constant.go +++ b/node/stmt/constant.go @@ -13,7 +13,7 @@ type Constant struct { Expr node.Node } -func NewConstant(ConstantName node.Node, Expr node.Node, PhpDocComment string) node.Node { +func NewConstant(ConstantName node.Node, Expr node.Node, PhpDocComment string) *Constant { return &Constant{ nil, nil, diff --git a/node/stmt/continue.go b/node/stmt/continue.go index 773084d..9774525 100644 --- a/node/stmt/continue.go +++ b/node/stmt/continue.go @@ -11,7 +11,7 @@ type Continue struct { Expr node.Node } -func NewContinue(Expr node.Node) node.Node { +func NewContinue(Expr node.Node) *Continue { return &Continue{ nil, nil, diff --git a/node/stmt/declare.go b/node/stmt/declare.go index 828cd7d..df619cd 100644 --- a/node/stmt/declare.go +++ b/node/stmt/declare.go @@ -12,7 +12,7 @@ type Declare struct { Stmt node.Node } -func NewDeclare(Consts []node.Node, Stmt node.Node) node.Node { +func NewDeclare(Consts []node.Node, Stmt node.Node) *Declare { return &Declare{ nil, nil, diff --git a/node/stmt/default.go b/node/stmt/default.go index 7a2d629..6983f40 100644 --- a/node/stmt/default.go +++ b/node/stmt/default.go @@ -11,7 +11,7 @@ type Default struct { Stmts []node.Node } -func NewDefault(Stmts []node.Node) node.Node { +func NewDefault(Stmts []node.Node) *Default { return &Default{ nil, nil, diff --git a/node/stmt/do.go b/node/stmt/do.go index 8f4535f..6c33134 100644 --- a/node/stmt/do.go +++ b/node/stmt/do.go @@ -12,7 +12,7 @@ type Do struct { Cond node.Node } -func NewDo(Stmt node.Node, Cond node.Node) node.Node { +func NewDo(Stmt node.Node, Cond node.Node) *Do { return &Do{ nil, nil, diff --git a/node/stmt/echo.go b/node/stmt/echo.go index 5a6054d..4f457d3 100644 --- a/node/stmt/echo.go +++ b/node/stmt/echo.go @@ -11,7 +11,7 @@ type Echo struct { Exprs []node.Node } -func NewEcho(Exprs []node.Node) node.Node { +func NewEcho(Exprs []node.Node) *Echo { return &Echo{ nil, nil, diff --git a/node/stmt/else.go b/node/stmt/else.go index fec37bc..17ef2b3 100644 --- a/node/stmt/else.go +++ b/node/stmt/else.go @@ -11,7 +11,7 @@ type Else struct { Stmt node.Node } -func NewElse(Stmt node.Node) node.Node { +func NewElse(Stmt node.Node) *Else { return &Else{ nil, nil, diff --git a/node/stmt/else_if.go b/node/stmt/else_if.go index 6e06e0e..3a4472e 100644 --- a/node/stmt/else_if.go +++ b/node/stmt/else_if.go @@ -12,7 +12,7 @@ type ElseIf struct { Stmt node.Node } -func NewElseIf(Cond node.Node, Stmt node.Node) node.Node { +func NewElseIf(Cond node.Node, Stmt node.Node) *ElseIf { return &ElseIf{ nil, nil, diff --git a/node/stmt/expression.go b/node/stmt/expression.go index 93f6d37..9afdad1 100644 --- a/node/stmt/expression.go +++ b/node/stmt/expression.go @@ -11,7 +11,7 @@ type Expression struct { Expr node.Node } -func NewExpression(Expr node.Node) node.Node { +func NewExpression(Expr node.Node) *Expression { return &Expression{ nil, nil, diff --git a/node/stmt/finally.go b/node/stmt/finally.go index d2a5df1..cec047f 100644 --- a/node/stmt/finally.go +++ b/node/stmt/finally.go @@ -11,7 +11,7 @@ type Finally struct { Stmts []node.Node } -func NewFinally(Stmts []node.Node) node.Node { +func NewFinally(Stmts []node.Node) *Finally { return &Finally{ nil, nil, diff --git a/node/stmt/for.go b/node/stmt/for.go index f6dd0ff..13f8cef 100644 --- a/node/stmt/for.go +++ b/node/stmt/for.go @@ -14,7 +14,7 @@ type For struct { Stmt node.Node } -func NewFor(Init []node.Node, Cond []node.Node, Loop []node.Node, Stmt node.Node) node.Node { +func NewFor(Init []node.Node, Cond []node.Node, Loop []node.Node, Stmt node.Node) *For { return &For{ nil, nil, diff --git a/node/stmt/foreach.go b/node/stmt/foreach.go index d328438..a86edcb 100644 --- a/node/stmt/foreach.go +++ b/node/stmt/foreach.go @@ -15,7 +15,7 @@ type Foreach struct { Stmt node.Node } -func NewForeach(Expr node.Node, Key node.Node, Variable node.Node, Stmt node.Node, ByRef bool) node.Node { +func NewForeach(Expr node.Node, Key node.Node, Variable node.Node, Stmt node.Node, ByRef bool) *Foreach { return &Foreach{ nil, nil, diff --git a/node/stmt/function.go b/node/stmt/function.go index 83bee35..d683b1b 100644 --- a/node/stmt/function.go +++ b/node/stmt/function.go @@ -16,7 +16,7 @@ type Function struct { Stmts []node.Node } -func NewFunction(FunctionName node.Node, ReturnsRef bool, Params []node.Node, ReturnType node.Node, Stmts []node.Node, PhpDocComment string) node.Node { +func NewFunction(FunctionName node.Node, ReturnsRef bool, Params []node.Node, ReturnType node.Node, Stmts []node.Node, PhpDocComment string) *Function { return &Function{ nil, nil, diff --git a/node/stmt/global.go b/node/stmt/global.go index 90bb138..3e21451 100644 --- a/node/stmt/global.go +++ b/node/stmt/global.go @@ -11,7 +11,7 @@ type Global struct { Vars []node.Node } -func NewGlobal(Vars []node.Node) node.Node { +func NewGlobal(Vars []node.Node) *Global { return &Global{ nil, nil, diff --git a/node/stmt/goto.go b/node/stmt/goto.go index 81ac98e..a203fdf 100644 --- a/node/stmt/goto.go +++ b/node/stmt/goto.go @@ -11,7 +11,7 @@ type Goto struct { Label node.Node } -func NewGoto(Label node.Node) node.Node { +func NewGoto(Label node.Node) *Goto { return &Goto{ nil, nil, diff --git a/node/stmt/group_use.go b/node/stmt/group_use.go index 628b392..988aca5 100644 --- a/node/stmt/group_use.go +++ b/node/stmt/group_use.go @@ -13,7 +13,7 @@ type GroupUse struct { UseList []node.Node } -func NewGroupUse(UseType node.Node, pRefix node.Node, UseList []node.Node) node.Node { +func NewGroupUse(UseType node.Node, pRefix node.Node, UseList []node.Node) *GroupUse { return &GroupUse{ nil, nil, diff --git a/node/stmt/halt_compiler.go b/node/stmt/halt_compiler.go index 7e7f259..c52cda5 100644 --- a/node/stmt/halt_compiler.go +++ b/node/stmt/halt_compiler.go @@ -10,7 +10,7 @@ type HaltCompiler struct { comments *[]comment.Comment } -func NewHaltCompiler() node.Node { +func NewHaltCompiler() *HaltCompiler { return &HaltCompiler{ nil, nil, diff --git a/node/stmt/if.go b/node/stmt/if.go index 90668e7..f0d5130 100644 --- a/node/stmt/if.go +++ b/node/stmt/if.go @@ -14,7 +14,7 @@ type If struct { _else node.Node } -func NewIf(Cond node.Node, Stmt node.Node) node.Node { +func NewIf(Cond node.Node, Stmt node.Node) *If { return &If{ nil, nil, diff --git a/node/stmt/inline_html.go b/node/stmt/inline_html.go index 38f2f42..f1b471c 100644 --- a/node/stmt/inline_html.go +++ b/node/stmt/inline_html.go @@ -11,7 +11,7 @@ type InlineHtml struct { Value string } -func NewInlineHtml(Value string) node.Node { +func NewInlineHtml(Value string) *InlineHtml { return &InlineHtml{ nil, nil, diff --git a/node/stmt/interface.go b/node/stmt/interface.go index 4f5b1c0..b951f02 100644 --- a/node/stmt/interface.go +++ b/node/stmt/interface.go @@ -14,7 +14,7 @@ type Interface struct { Stmts []node.Node } -func NewInterface(InterfaceName node.Node, Extends []node.Node, Stmts []node.Node, PhpDocComment string) node.Node { +func NewInterface(InterfaceName node.Node, Extends []node.Node, Stmts []node.Node, PhpDocComment string) *Interface { return &Interface{ nil, nil, diff --git a/node/stmt/label.go b/node/stmt/label.go index ee70300..86d5961 100644 --- a/node/stmt/label.go +++ b/node/stmt/label.go @@ -11,7 +11,7 @@ type Label struct { LabelName node.Node } -func NewLabel(LabelName node.Node) node.Node { +func NewLabel(LabelName node.Node) *Label { return &Label{ nil, nil, diff --git a/node/stmt/namespace.go b/node/stmt/namespace.go index 57b7d40..8593d74 100644 --- a/node/stmt/namespace.go +++ b/node/stmt/namespace.go @@ -12,7 +12,7 @@ type Namespace struct { Stmts []node.Node } -func NewNamespace(NamespaceName node.Node, Stmts []node.Node) node.Node { +func NewNamespace(NamespaceName node.Node, Stmts []node.Node) *Namespace { return &Namespace{ nil, nil, diff --git a/node/stmt/nop.go b/node/stmt/nop.go index d173ab5..1f25173 100644 --- a/node/stmt/nop.go +++ b/node/stmt/nop.go @@ -10,7 +10,7 @@ type Nop struct { comments *[]comment.Comment } -func NewNop() node.Node { +func NewNop() *Nop { return &Nop{ nil, nil, diff --git a/node/stmt/property.go b/node/stmt/property.go index 1097b71..999a8aa 100644 --- a/node/stmt/property.go +++ b/node/stmt/property.go @@ -13,7 +13,7 @@ type Property struct { Expr node.Node } -func NewProperty(Variable node.Node, Expr node.Node, PhpDocComment string) node.Node { +func NewProperty(Variable node.Node, Expr node.Node, PhpDocComment string) *Property { return &Property{ nil, nil, diff --git a/node/stmt/property_list.go b/node/stmt/property_list.go index b00ac7c..de199f8 100644 --- a/node/stmt/property_list.go +++ b/node/stmt/property_list.go @@ -12,7 +12,7 @@ type PropertyList struct { Properties []node.Node } -func NewPropertyList(Modifiers []node.Node, Properties []node.Node) node.Node { +func NewPropertyList(Modifiers []node.Node, Properties []node.Node) *PropertyList { return &PropertyList{ nil, nil, diff --git a/node/stmt/return.go b/node/stmt/return.go index 432cffe..3b2b70a 100644 --- a/node/stmt/return.go +++ b/node/stmt/return.go @@ -11,7 +11,7 @@ type Return struct { Expr node.Node } -func NewReturn(Expr node.Node) node.Node { +func NewReturn(Expr node.Node) *Return { return &Return{ nil, nil, diff --git a/node/stmt/static.go b/node/stmt/static.go index 4db90e0..501352a 100644 --- a/node/stmt/static.go +++ b/node/stmt/static.go @@ -11,7 +11,7 @@ type Static struct { Vars []node.Node } -func NewStatic(Vars []node.Node) node.Node { +func NewStatic(Vars []node.Node) *Static { return &Static{ nil, nil, diff --git a/node/stmt/static_var.go b/node/stmt/static_var.go index 14de22c..201d186 100644 --- a/node/stmt/static_var.go +++ b/node/stmt/static_var.go @@ -12,7 +12,7 @@ type StaticVar struct { Expr node.Node } -func NewStaticVar(Variable node.Node, Expr node.Node) node.Node { +func NewStaticVar(Variable node.Node, Expr node.Node) *StaticVar { return &StaticVar{ nil, nil, diff --git a/node/stmt/stmt_list.go b/node/stmt/stmt_list.go index d4f1d16..a25685b 100644 --- a/node/stmt/stmt_list.go +++ b/node/stmt/stmt_list.go @@ -11,7 +11,7 @@ type StmtList struct { Stmts []node.Node } -func NewStmtList(Stmts []node.Node) node.Node { +func NewStmtList(Stmts []node.Node) *StmtList { return &StmtList{ nil, nil, diff --git a/node/stmt/switch.go b/node/stmt/switch.go index 71e1e6a..782b3d6 100644 --- a/node/stmt/switch.go +++ b/node/stmt/switch.go @@ -14,7 +14,7 @@ type Switch struct { cases []node.Node } -func NewSwitch(token token.Token, Cond node.Node, cases []node.Node) node.Node { +func NewSwitch(token token.Token, Cond node.Node, cases []node.Node) *Switch { return &Switch{ nil, nil, diff --git a/node/stmt/throw.go b/node/stmt/throw.go index 9b0db9b..13b7fb0 100644 --- a/node/stmt/throw.go +++ b/node/stmt/throw.go @@ -11,7 +11,7 @@ type Throw struct { Expr node.Node } -func NewThrow(Expr node.Node) node.Node { +func NewThrow(Expr node.Node) *Throw { return &Throw{ nil, nil, diff --git a/node/stmt/trait.go b/node/stmt/trait.go index ae6c927..496b08a 100644 --- a/node/stmt/trait.go +++ b/node/stmt/trait.go @@ -13,7 +13,7 @@ type Trait struct { Stmts []node.Node } -func NewTrait(TraitName node.Node, Stmts []node.Node, PhpDocComment string) node.Node { +func NewTrait(TraitName node.Node, Stmts []node.Node, PhpDocComment string) *Trait { return &Trait{ nil, nil, diff --git a/node/stmt/trait_method_ref.go b/node/stmt/trait_method_ref.go index 7157dfb..da303e2 100644 --- a/node/stmt/trait_method_ref.go +++ b/node/stmt/trait_method_ref.go @@ -12,7 +12,7 @@ type TraitMethodRef struct { Method node.Node } -func NewTraitMethodRef(Trait node.Node, Method node.Node) node.Node { +func NewTraitMethodRef(Trait node.Node, Method node.Node) *TraitMethodRef { return &TraitMethodRef{ nil, nil, diff --git a/node/stmt/trait_use.go b/node/stmt/trait_use.go index cc955c4..d611fd5 100644 --- a/node/stmt/trait_use.go +++ b/node/stmt/trait_use.go @@ -12,7 +12,7 @@ type TraitUse struct { Adaptations []node.Node } -func NewTraitUse(Traits []node.Node, Adaptations []node.Node) node.Node { +func NewTraitUse(Traits []node.Node, Adaptations []node.Node) *TraitUse { return &TraitUse{ nil, nil, diff --git a/node/stmt/trait_use_alias.go b/node/stmt/trait_use_alias.go index 6ad9e24..306f78f 100644 --- a/node/stmt/trait_use_alias.go +++ b/node/stmt/trait_use_alias.go @@ -13,7 +13,7 @@ type TraitUseAlias struct { Alias node.Node } -func NewTraitUseAlias(Ref node.Node, Modifier node.Node, Alias node.Node) node.Node { +func NewTraitUseAlias(Ref node.Node, Modifier node.Node, Alias node.Node) *TraitUseAlias { return &TraitUseAlias{ nil, nil, diff --git a/node/stmt/trait_use_precedence.go b/node/stmt/trait_use_precedence.go index dbe9025..fe9caea 100644 --- a/node/stmt/trait_use_precedence.go +++ b/node/stmt/trait_use_precedence.go @@ -12,7 +12,7 @@ type TraitUsePrecedence struct { Insteadof node.Node } -func NewTraitUsePrecedence(Ref node.Node, Insteadof node.Node) node.Node { +func NewTraitUsePrecedence(Ref node.Node, Insteadof node.Node) *TraitUsePrecedence { return &TraitUsePrecedence{ nil, nil, diff --git a/node/stmt/try.go b/node/stmt/try.go index b741387..046829b 100644 --- a/node/stmt/try.go +++ b/node/stmt/try.go @@ -13,7 +13,7 @@ type Try struct { Finally node.Node } -func NewTry(Stmts []node.Node, Catches []node.Node, Finally node.Node) node.Node { +func NewTry(Stmts []node.Node, Catches []node.Node, Finally node.Node) *Try { return &Try{ nil, nil, diff --git a/node/stmt/unset.go b/node/stmt/unset.go index f820002..b231d46 100644 --- a/node/stmt/unset.go +++ b/node/stmt/unset.go @@ -11,7 +11,7 @@ type Unset struct { Vars []node.Node } -func NewUnset(Vars []node.Node) node.Node { +func NewUnset(Vars []node.Node) *Unset { return &Unset{ nil, nil, diff --git a/node/stmt/use.go b/node/stmt/use.go index eb0ce41..455504d 100644 --- a/node/stmt/use.go +++ b/node/stmt/use.go @@ -13,7 +13,7 @@ type Use struct { Alias node.Node } -func NewUse(UseType node.Node, use node.Node, Alias node.Node) node.Node { +func NewUse(UseType node.Node, use node.Node, Alias node.Node) *Use { return &Use{ nil, nil, diff --git a/node/stmt/use_list.go b/node/stmt/use_list.go index 2d4ddb6..a6400e5 100644 --- a/node/stmt/use_list.go +++ b/node/stmt/use_list.go @@ -12,7 +12,7 @@ type UseList struct { Uses []node.Node } -func NewUseList(UseType node.Node, Uses []node.Node) node.Node { +func NewUseList(UseType node.Node, Uses []node.Node) *UseList { return &UseList{ nil, nil, diff --git a/node/stmt/while.go b/node/stmt/while.go index 4c9f8fd..cd7e66e 100644 --- a/node/stmt/while.go +++ b/node/stmt/while.go @@ -14,7 +14,7 @@ type While struct { Stmt node.Node } -func NewWhile(Token token.Token, Cond node.Node, Stmt node.Node) node.Node { +func NewWhile(Token token.Token, Cond node.Node, Stmt node.Node) *While { return &While{ nil, nil, diff --git a/parser/parser.go b/parser/parser.go index 3361799..3f2bbd2 100644 --- a/parser/parser.go +++ b/parser/parser.go @@ -20,7 +20,7 @@ import ( "strings" ) -var rootnode = stmt.NewStmtList([]node.Node{}) +var rootnode node.Node func Parse(src io.Reader, fName string) node.Node { yyDebug = 0 diff --git a/parser/parser.y b/parser/parser.y index 0c7dc80..db43d24 100644 --- a/parser/parser.y +++ b/parser/parser.y @@ -17,7 +17,7 @@ import ( "github.com/z7zmey/php-parser/comment" ) -var rootnode = stmt.NewStmtList([]node.Node{}) +var rootnode node.Node func Parse(src io.Reader, fName string) node.Node { yyDebug = 0