diff --git a/comment/doc_comment.go b/comment/doc_comment.go index 9de49c7..8988e64 100644 --- a/comment/doc_comment.go +++ b/comment/doc_comment.go @@ -4,7 +4,7 @@ type DocComment struct { value string } -func NewDocComment(value string) Comment { +func NewDocComment(value string) *DocComment { return &DocComment{ value, } diff --git a/comment/plain_comment.go b/comment/plain_comment.go index f740ac2..ea8a0c5 100644 --- a/comment/plain_comment.go +++ b/comment/plain_comment.go @@ -4,7 +4,7 @@ type PlainComment struct { value string } -func NewPlainComment(value string) Comment { +func NewPlainComment(value string) *PlainComment { return &PlainComment{ value, } diff --git a/dumper.go b/dumper.go index 1f1cd21..83d51ef 100644 --- a/dumper.go +++ b/dumper.go @@ -22,9 +22,9 @@ func (d dumper) EnterNode(n node.Node) bool { } fmt.Println() - if c := n.Comments(); c != nil && len(*c) > 0 { + if c := n.Comments(); c != nil && len(c) > 0 { fmt.Printf("%vcomments:\n", d.indent+" ") - for _, cc := range *c { + for _, cc := range c { fmt.Printf("%v%q\n", d.indent+" ", cc) } } diff --git a/node/argument.go b/node/argument.go index bf3b2c0..cc8447a 100644 --- a/node/argument.go +++ b/node/argument.go @@ -4,7 +4,7 @@ import "github.com/z7zmey/php-parser/comment" type Argument struct { position *Position - comments *[]comment.Comment + comments []comment.Comment Variadic bool Expr Node } @@ -33,11 +33,11 @@ func (n *Argument) SetPosition(p *Position) Node { return n } -func (n *Argument) Comments() *[]comment.Comment { +func (n *Argument) Comments() []comment.Comment { return n.comments } -func (n *Argument) SetComments(c *[]comment.Comment) Node { +func (n *Argument) SetComments(c []comment.Comment) Node { n.comments = c return n } diff --git a/node/expr/array.go b/node/expr/array.go index bf6a1f4..b279cf2 100644 --- a/node/expr/array.go +++ b/node/expr/array.go @@ -7,7 +7,7 @@ import ( type Array struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Items []node.Node } @@ -32,11 +32,11 @@ func (n *Array) SetPosition(p *node.Position) node.Node { return n } -func (n *Array) Comments() *[]comment.Comment { +func (n *Array) Comments() []comment.Comment { return n.comments } -func (n *Array) SetComments(c *[]comment.Comment) node.Node { +func (n *Array) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/array_dim_fetch.go b/node/expr/array_dim_fetch.go index 519c232..5b70177 100644 --- a/node/expr/array_dim_fetch.go +++ b/node/expr/array_dim_fetch.go @@ -7,7 +7,7 @@ import ( type ArrayDimFetch struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Variable node.Node Dim node.Node } @@ -34,11 +34,11 @@ func (n *ArrayDimFetch) SetPosition(p *node.Position) node.Node { return n } -func (n *ArrayDimFetch) Comments() *[]comment.Comment { +func (n *ArrayDimFetch) Comments() []comment.Comment { return n.comments } -func (n *ArrayDimFetch) SetComments(c *[]comment.Comment) node.Node { +func (n *ArrayDimFetch) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/array_item.go b/node/expr/array_item.go index 804c430..f18fcb3 100644 --- a/node/expr/array_item.go +++ b/node/expr/array_item.go @@ -7,7 +7,7 @@ import ( type ArrayItem struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment ByRef bool Key node.Node Val node.Node @@ -38,11 +38,11 @@ func (n *ArrayItem) SetPosition(p *node.Position) node.Node { return n } -func (n *ArrayItem) Comments() *[]comment.Comment { +func (n *ArrayItem) Comments() []comment.Comment { return n.comments } -func (n *ArrayItem) SetComments(c *[]comment.Comment) node.Node { +func (n *ArrayItem) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/assign_op/assign.go b/node/expr/assign_op/assign.go index 06c7f9a..5ba95f0 100644 --- a/node/expr/assign_op/assign.go +++ b/node/expr/assign_op/assign.go @@ -33,11 +33,11 @@ func (n *Assign) SetPosition(p *node.Position) node.Node { return n } -func (n *Assign) Comments() *[]comment.Comment { +func (n *Assign) Comments() []comment.Comment { return n.comments } -func (n *Assign) SetComments(c *[]comment.Comment) node.Node { +func (n *Assign) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/assign_op/assign_op.go b/node/expr/assign_op/assign_op.go index 5c40f2f..49a886d 100644 --- a/node/expr/assign_op/assign_op.go +++ b/node/expr/assign_op/assign_op.go @@ -7,7 +7,7 @@ import ( type AssignOp struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Variable node.Node Expression node.Node } diff --git a/node/expr/assign_op/assign_ref.go b/node/expr/assign_op/assign_ref.go index 18fea9d..daa4de5 100644 --- a/node/expr/assign_op/assign_ref.go +++ b/node/expr/assign_op/assign_ref.go @@ -33,11 +33,11 @@ func (n *AssignRef) SetPosition(p *node.Position) node.Node { return n } -func (n *AssignRef) Comments() *[]comment.Comment { +func (n *AssignRef) Comments() []comment.Comment { return n.comments } -func (n *AssignRef) SetComments(c *[]comment.Comment) node.Node { +func (n *AssignRef) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/assign_op/bitwise_and.go b/node/expr/assign_op/bitwise_and.go index 3d3275a..7b64441 100644 --- a/node/expr/assign_op/bitwise_and.go +++ b/node/expr/assign_op/bitwise_and.go @@ -33,11 +33,11 @@ func (n *BitwiseAnd) SetPosition(p *node.Position) node.Node { return n } -func (n *BitwiseAnd) Comments() *[]comment.Comment { +func (n *BitwiseAnd) Comments() []comment.Comment { return n.comments } -func (n *BitwiseAnd) SetComments(c *[]comment.Comment) node.Node { +func (n *BitwiseAnd) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/assign_op/bitwise_or.go b/node/expr/assign_op/bitwise_or.go index de50f9c..e2f0b35 100644 --- a/node/expr/assign_op/bitwise_or.go +++ b/node/expr/assign_op/bitwise_or.go @@ -33,11 +33,11 @@ func (n *BitwiseOr) SetPosition(p *node.Position) node.Node { return n } -func (n *BitwiseOr) Comments() *[]comment.Comment { +func (n *BitwiseOr) Comments() []comment.Comment { return n.comments } -func (n *BitwiseOr) SetComments(c *[]comment.Comment) node.Node { +func (n *BitwiseOr) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/assign_op/bitwise_xor.go b/node/expr/assign_op/bitwise_xor.go index 55d9f44..a49eceb 100644 --- a/node/expr/assign_op/bitwise_xor.go +++ b/node/expr/assign_op/bitwise_xor.go @@ -33,11 +33,11 @@ func (n *BitwiseXor) SetPosition(p *node.Position) node.Node { return n } -func (n *BitwiseXor) Comments() *[]comment.Comment { +func (n *BitwiseXor) Comments() []comment.Comment { return n.comments } -func (n *BitwiseXor) SetComments(c *[]comment.Comment) node.Node { +func (n *BitwiseXor) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/assign_op/concat.go b/node/expr/assign_op/concat.go index 687971e..1c74b30 100644 --- a/node/expr/assign_op/concat.go +++ b/node/expr/assign_op/concat.go @@ -33,11 +33,11 @@ func (n *Concat) SetPosition(p *node.Position) node.Node { return n } -func (n *Concat) Comments() *[]comment.Comment { +func (n *Concat) Comments() []comment.Comment { return n.comments } -func (n *Concat) SetComments(c *[]comment.Comment) node.Node { +func (n *Concat) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/assign_op/div.go b/node/expr/assign_op/div.go index 040f507..899dab7 100644 --- a/node/expr/assign_op/div.go +++ b/node/expr/assign_op/div.go @@ -33,11 +33,11 @@ func (n *Div) SetPosition(p *node.Position) node.Node { return n } -func (n *Div) Comments() *[]comment.Comment { +func (n *Div) Comments() []comment.Comment { return n.comments } -func (n *Div) SetComments(c *[]comment.Comment) node.Node { +func (n *Div) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/assign_op/minus.go b/node/expr/assign_op/minus.go index 7c17819..d4d3480 100644 --- a/node/expr/assign_op/minus.go +++ b/node/expr/assign_op/minus.go @@ -33,11 +33,11 @@ func (n *Minus) SetPosition(p *node.Position) node.Node { return n } -func (n *Minus) Comments() *[]comment.Comment { +func (n *Minus) Comments() []comment.Comment { return n.comments } -func (n *Minus) SetComments(c *[]comment.Comment) node.Node { +func (n *Minus) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/assign_op/mod.go b/node/expr/assign_op/mod.go index 65f89de..c925ba3 100644 --- a/node/expr/assign_op/mod.go +++ b/node/expr/assign_op/mod.go @@ -33,11 +33,11 @@ func (n *Mod) SetPosition(p *node.Position) node.Node { return n } -func (n *Mod) Comments() *[]comment.Comment { +func (n *Mod) Comments() []comment.Comment { return n.comments } -func (n *Mod) SetComments(c *[]comment.Comment) node.Node { +func (n *Mod) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/assign_op/mul.go b/node/expr/assign_op/mul.go index 23905a7..a6fa487 100644 --- a/node/expr/assign_op/mul.go +++ b/node/expr/assign_op/mul.go @@ -33,11 +33,11 @@ func (n *Mul) SetPosition(p *node.Position) node.Node { return n } -func (n *Mul) Comments() *[]comment.Comment { +func (n *Mul) Comments() []comment.Comment { return n.comments } -func (n *Mul) SetComments(c *[]comment.Comment) node.Node { +func (n *Mul) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/assign_op/plus.go b/node/expr/assign_op/plus.go index 6385444..51f3c15 100644 --- a/node/expr/assign_op/plus.go +++ b/node/expr/assign_op/plus.go @@ -33,11 +33,11 @@ func (n *Plus) SetPosition(p *node.Position) node.Node { return n } -func (n *Plus) Comments() *[]comment.Comment { +func (n *Plus) Comments() []comment.Comment { return n.comments } -func (n *Plus) SetComments(c *[]comment.Comment) node.Node { +func (n *Plus) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/assign_op/pow.go b/node/expr/assign_op/pow.go index 1ba4342..fd0a84a 100644 --- a/node/expr/assign_op/pow.go +++ b/node/expr/assign_op/pow.go @@ -33,11 +33,11 @@ func (n *Pow) SetPosition(p *node.Position) node.Node { return n } -func (n *Pow) Comments() *[]comment.Comment { +func (n *Pow) Comments() []comment.Comment { return n.comments } -func (n *Pow) SetComments(c *[]comment.Comment) node.Node { +func (n *Pow) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/assign_op/shift_left.go b/node/expr/assign_op/shift_left.go index cb6732c..4a85a0a 100644 --- a/node/expr/assign_op/shift_left.go +++ b/node/expr/assign_op/shift_left.go @@ -33,11 +33,11 @@ func (n *ShiftLeft) SetPosition(p *node.Position) node.Node { return n } -func (n *ShiftLeft) Comments() *[]comment.Comment { +func (n *ShiftLeft) Comments() []comment.Comment { return n.comments } -func (n *ShiftLeft) SetComments(c *[]comment.Comment) node.Node { +func (n *ShiftLeft) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/assign_op/shift_right.go b/node/expr/assign_op/shift_right.go index fed31ac..c3d686e 100644 --- a/node/expr/assign_op/shift_right.go +++ b/node/expr/assign_op/shift_right.go @@ -33,11 +33,11 @@ func (n *ShiftRight) SetPosition(p *node.Position) node.Node { return n } -func (n *ShiftRight) Comments() *[]comment.Comment { +func (n *ShiftRight) Comments() []comment.Comment { return n.comments } -func (n *ShiftRight) SetComments(c *[]comment.Comment) node.Node { +func (n *ShiftRight) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/binary_op/binary_op.go b/node/expr/binary_op/binary_op.go index 897534d..c40e918 100644 --- a/node/expr/binary_op/binary_op.go +++ b/node/expr/binary_op/binary_op.go @@ -7,7 +7,7 @@ import ( type BinaryOp struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Left node.Node Right node.Node } diff --git a/node/expr/binary_op/bitwise_and.go b/node/expr/binary_op/bitwise_and.go index 67522cb..a13d6c8 100644 --- a/node/expr/binary_op/bitwise_and.go +++ b/node/expr/binary_op/bitwise_and.go @@ -33,11 +33,11 @@ func (n *BitwiseAnd) SetPosition(p *node.Position) node.Node { return n } -func (n *BitwiseAnd) Comments() *[]comment.Comment { +func (n *BitwiseAnd) Comments() []comment.Comment { return n.comments } -func (n *BitwiseAnd) SetComments(c *[]comment.Comment) node.Node { +func (n *BitwiseAnd) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/binary_op/bitwise_or.go b/node/expr/binary_op/bitwise_or.go index 28dea05..886d094 100644 --- a/node/expr/binary_op/bitwise_or.go +++ b/node/expr/binary_op/bitwise_or.go @@ -33,11 +33,11 @@ func (n *BitwiseOr) SetPosition(p *node.Position) node.Node { return n } -func (n *BitwiseOr) Comments() *[]comment.Comment { +func (n *BitwiseOr) Comments() []comment.Comment { return n.comments } -func (n *BitwiseOr) SetComments(c *[]comment.Comment) node.Node { +func (n *BitwiseOr) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/binary_op/bitwise_xor.go b/node/expr/binary_op/bitwise_xor.go index c081646..511ebd2 100644 --- a/node/expr/binary_op/bitwise_xor.go +++ b/node/expr/binary_op/bitwise_xor.go @@ -33,11 +33,11 @@ func (n *BitwiseXor) SetPosition(p *node.Position) node.Node { return n } -func (n *BitwiseXor) Comments() *[]comment.Comment { +func (n *BitwiseXor) Comments() []comment.Comment { return n.comments } -func (n *BitwiseXor) SetComments(c *[]comment.Comment) node.Node { +func (n *BitwiseXor) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/binary_op/boolean_and.go b/node/expr/binary_op/boolean_and.go index 7342e69..e563847 100644 --- a/node/expr/binary_op/boolean_and.go +++ b/node/expr/binary_op/boolean_and.go @@ -33,11 +33,11 @@ func (n *BooleanAnd) SetPosition(p *node.Position) node.Node { return n } -func (n *BooleanAnd) Comments() *[]comment.Comment { +func (n *BooleanAnd) Comments() []comment.Comment { return n.comments } -func (n *BooleanAnd) SetComments(c *[]comment.Comment) node.Node { +func (n *BooleanAnd) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/binary_op/boolean_or.go b/node/expr/binary_op/boolean_or.go index 5b7a834..6d620b2 100644 --- a/node/expr/binary_op/boolean_or.go +++ b/node/expr/binary_op/boolean_or.go @@ -33,11 +33,11 @@ func (n *BooleanOr) SetPosition(p *node.Position) node.Node { return n } -func (n *BooleanOr) Comments() *[]comment.Comment { +func (n *BooleanOr) Comments() []comment.Comment { return n.comments } -func (n *BooleanOr) SetComments(c *[]comment.Comment) node.Node { +func (n *BooleanOr) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/binary_op/coalesce.go b/node/expr/binary_op/coalesce.go index 28dd511..a133ee2 100644 --- a/node/expr/binary_op/coalesce.go +++ b/node/expr/binary_op/coalesce.go @@ -33,11 +33,11 @@ func (n *Coalesce) SetPosition(p *node.Position) node.Node { return n } -func (n *Coalesce) Comments() *[]comment.Comment { +func (n *Coalesce) Comments() []comment.Comment { return n.comments } -func (n *Coalesce) SetComments(c *[]comment.Comment) node.Node { +func (n *Coalesce) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/binary_op/concat.go b/node/expr/binary_op/concat.go index f8b262f..ec876ec 100644 --- a/node/expr/binary_op/concat.go +++ b/node/expr/binary_op/concat.go @@ -33,11 +33,11 @@ func (n *Concat) SetPosition(p *node.Position) node.Node { return n } -func (n *Concat) Comments() *[]comment.Comment { +func (n *Concat) Comments() []comment.Comment { return n.comments } -func (n *Concat) SetComments(c *[]comment.Comment) node.Node { +func (n *Concat) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/binary_op/div.go b/node/expr/binary_op/div.go index 8a83448..07280e4 100644 --- a/node/expr/binary_op/div.go +++ b/node/expr/binary_op/div.go @@ -33,11 +33,11 @@ func (n *Div) SetPosition(p *node.Position) node.Node { return n } -func (n *Div) Comments() *[]comment.Comment { +func (n *Div) Comments() []comment.Comment { return n.comments } -func (n *Div) SetComments(c *[]comment.Comment) node.Node { +func (n *Div) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/binary_op/equal.go b/node/expr/binary_op/equal.go index dd5a43b..8e3e979 100644 --- a/node/expr/binary_op/equal.go +++ b/node/expr/binary_op/equal.go @@ -33,11 +33,11 @@ func (n *Equal) SetPosition(p *node.Position) node.Node { return n } -func (n *Equal) Comments() *[]comment.Comment { +func (n *Equal) Comments() []comment.Comment { return n.comments } -func (n *Equal) SetComments(c *[]comment.Comment) node.Node { +func (n *Equal) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/binary_op/greater.go b/node/expr/binary_op/greater.go index e79d90d..99190ad 100644 --- a/node/expr/binary_op/greater.go +++ b/node/expr/binary_op/greater.go @@ -33,11 +33,11 @@ func (n *Greater) SetPosition(p *node.Position) node.Node { return n } -func (n *Greater) Comments() *[]comment.Comment { +func (n *Greater) Comments() []comment.Comment { return n.comments } -func (n *Greater) SetComments(c *[]comment.Comment) node.Node { +func (n *Greater) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/binary_op/greater_or_equal.go b/node/expr/binary_op/greater_or_equal.go index 8e19384..3057185 100644 --- a/node/expr/binary_op/greater_or_equal.go +++ b/node/expr/binary_op/greater_or_equal.go @@ -33,11 +33,11 @@ func (n *GreaterOrEqual) SetPosition(p *node.Position) node.Node { return n } -func (n *GreaterOrEqual) Comments() *[]comment.Comment { +func (n *GreaterOrEqual) Comments() []comment.Comment { return n.comments } -func (n *GreaterOrEqual) SetComments(c *[]comment.Comment) node.Node { +func (n *GreaterOrEqual) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/binary_op/identical.go b/node/expr/binary_op/identical.go index a11501e..f589c18 100644 --- a/node/expr/binary_op/identical.go +++ b/node/expr/binary_op/identical.go @@ -33,11 +33,11 @@ func (n *Identical) SetPosition(p *node.Position) node.Node { return n } -func (n *Identical) Comments() *[]comment.Comment { +func (n *Identical) Comments() []comment.Comment { return n.comments } -func (n *Identical) SetComments(c *[]comment.Comment) node.Node { +func (n *Identical) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/binary_op/logical_and.go b/node/expr/binary_op/logical_and.go index 05c8196..0a1e715 100644 --- a/node/expr/binary_op/logical_and.go +++ b/node/expr/binary_op/logical_and.go @@ -33,11 +33,11 @@ func (n *LogicalAnd) SetPosition(p *node.Position) node.Node { return n } -func (n *LogicalAnd) Comments() *[]comment.Comment { +func (n *LogicalAnd) Comments() []comment.Comment { return n.comments } -func (n *LogicalAnd) SetComments(c *[]comment.Comment) node.Node { +func (n *LogicalAnd) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/binary_op/logical_or.go b/node/expr/binary_op/logical_or.go index 0cd0ec7..c2ade04 100644 --- a/node/expr/binary_op/logical_or.go +++ b/node/expr/binary_op/logical_or.go @@ -33,11 +33,11 @@ func (n *LogicalOr) SetPosition(p *node.Position) node.Node { return n } -func (n *LogicalOr) Comments() *[]comment.Comment { +func (n *LogicalOr) Comments() []comment.Comment { return n.comments } -func (n *LogicalOr) SetComments(c *[]comment.Comment) node.Node { +func (n *LogicalOr) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/binary_op/logical_xor.go b/node/expr/binary_op/logical_xor.go index 074c424..e67215f 100644 --- a/node/expr/binary_op/logical_xor.go +++ b/node/expr/binary_op/logical_xor.go @@ -33,11 +33,11 @@ func (n *LogicalXor) SetPosition(p *node.Position) node.Node { return n } -func (n *LogicalXor) Comments() *[]comment.Comment { +func (n *LogicalXor) Comments() []comment.Comment { return n.comments } -func (n *LogicalXor) SetComments(c *[]comment.Comment) node.Node { +func (n *LogicalXor) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/binary_op/minus.go b/node/expr/binary_op/minus.go index d70d768..e772efe 100644 --- a/node/expr/binary_op/minus.go +++ b/node/expr/binary_op/minus.go @@ -33,11 +33,11 @@ func (n *Minus) SetPosition(p *node.Position) node.Node { return n } -func (n *Minus) Comments() *[]comment.Comment { +func (n *Minus) Comments() []comment.Comment { return n.comments } -func (n *Minus) SetComments(c *[]comment.Comment) node.Node { +func (n *Minus) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/binary_op/mod.go b/node/expr/binary_op/mod.go index 601afd0..f90f878 100644 --- a/node/expr/binary_op/mod.go +++ b/node/expr/binary_op/mod.go @@ -33,11 +33,11 @@ func (n *Mod) SetPosition(p *node.Position) node.Node { return n } -func (n *Mod) Comments() *[]comment.Comment { +func (n *Mod) Comments() []comment.Comment { return n.comments } -func (n *Mod) SetComments(c *[]comment.Comment) node.Node { +func (n *Mod) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/binary_op/mul.go b/node/expr/binary_op/mul.go index 206bd78..39eb9dc 100644 --- a/node/expr/binary_op/mul.go +++ b/node/expr/binary_op/mul.go @@ -33,11 +33,11 @@ func (n *Mul) SetPosition(p *node.Position) node.Node { return n } -func (n *Mul) Comments() *[]comment.Comment { +func (n *Mul) Comments() []comment.Comment { return n.comments } -func (n *Mul) SetComments(c *[]comment.Comment) node.Node { +func (n *Mul) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/binary_op/not_equal.go b/node/expr/binary_op/not_equal.go index ed2a4a8..81e51e3 100644 --- a/node/expr/binary_op/not_equal.go +++ b/node/expr/binary_op/not_equal.go @@ -33,11 +33,11 @@ func (n *NotEqual) SetPosition(p *node.Position) node.Node { return n } -func (n *NotEqual) Comments() *[]comment.Comment { +func (n *NotEqual) Comments() []comment.Comment { return n.comments } -func (n *NotEqual) SetComments(c *[]comment.Comment) node.Node { +func (n *NotEqual) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/binary_op/not_identical.go b/node/expr/binary_op/not_identical.go index a9a213e..0810ffe 100644 --- a/node/expr/binary_op/not_identical.go +++ b/node/expr/binary_op/not_identical.go @@ -33,11 +33,11 @@ func (n *NotIdentical) SetPosition(p *node.Position) node.Node { return n } -func (n *NotIdentical) Comments() *[]comment.Comment { +func (n *NotIdentical) Comments() []comment.Comment { return n.comments } -func (n *NotIdentical) SetComments(c *[]comment.Comment) node.Node { +func (n *NotIdentical) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/binary_op/plus.go b/node/expr/binary_op/plus.go index 82076b9..d4d1ff1 100644 --- a/node/expr/binary_op/plus.go +++ b/node/expr/binary_op/plus.go @@ -33,11 +33,11 @@ func (n *Plus) SetPosition(p *node.Position) node.Node { return n } -func (n *Plus) Comments() *[]comment.Comment { +func (n *Plus) Comments() []comment.Comment { return n.comments } -func (n *Plus) SetComments(c *[]comment.Comment) node.Node { +func (n *Plus) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/binary_op/pow.go b/node/expr/binary_op/pow.go index 0e179d2..3437fbf 100644 --- a/node/expr/binary_op/pow.go +++ b/node/expr/binary_op/pow.go @@ -33,11 +33,11 @@ func (n *Pow) SetPosition(p *node.Position) node.Node { return n } -func (n *Pow) Comments() *[]comment.Comment { +func (n *Pow) Comments() []comment.Comment { return n.comments } -func (n *Pow) SetComments(c *[]comment.Comment) node.Node { +func (n *Pow) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/binary_op/shift_left.go b/node/expr/binary_op/shift_left.go index e366d7b..4c2a7d2 100644 --- a/node/expr/binary_op/shift_left.go +++ b/node/expr/binary_op/shift_left.go @@ -33,11 +33,11 @@ func (n *ShiftLeft) SetPosition(p *node.Position) node.Node { return n } -func (n *ShiftLeft) Comments() *[]comment.Comment { +func (n *ShiftLeft) Comments() []comment.Comment { return n.comments } -func (n *ShiftLeft) SetComments(c *[]comment.Comment) node.Node { +func (n *ShiftLeft) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/binary_op/shift_right.go b/node/expr/binary_op/shift_right.go index b0323bb..28809c2 100644 --- a/node/expr/binary_op/shift_right.go +++ b/node/expr/binary_op/shift_right.go @@ -33,11 +33,11 @@ func (n *ShiftRight) SetPosition(p *node.Position) node.Node { return n } -func (n *ShiftRight) Comments() *[]comment.Comment { +func (n *ShiftRight) Comments() []comment.Comment { return n.comments } -func (n *ShiftRight) SetComments(c *[]comment.Comment) node.Node { +func (n *ShiftRight) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/binary_op/smaller.go b/node/expr/binary_op/smaller.go index 0ad9fb7..071303f 100644 --- a/node/expr/binary_op/smaller.go +++ b/node/expr/binary_op/smaller.go @@ -33,11 +33,11 @@ func (n *Smaller) SetPosition(p *node.Position) node.Node { return n } -func (n *Smaller) Comments() *[]comment.Comment { +func (n *Smaller) Comments() []comment.Comment { return n.comments } -func (n *Smaller) SetComments(c *[]comment.Comment) node.Node { +func (n *Smaller) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/binary_op/smaller_or_equal.go b/node/expr/binary_op/smaller_or_equal.go index ab5ba1e..60568bf 100644 --- a/node/expr/binary_op/smaller_or_equal.go +++ b/node/expr/binary_op/smaller_or_equal.go @@ -33,11 +33,11 @@ func (n *SmallerOrEqual) SetPosition(p *node.Position) node.Node { return n } -func (n *SmallerOrEqual) Comments() *[]comment.Comment { +func (n *SmallerOrEqual) Comments() []comment.Comment { return n.comments } -func (n *SmallerOrEqual) SetComments(c *[]comment.Comment) node.Node { +func (n *SmallerOrEqual) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/binary_op/spaceship.go b/node/expr/binary_op/spaceship.go index 20b5eda..5461ba7 100644 --- a/node/expr/binary_op/spaceship.go +++ b/node/expr/binary_op/spaceship.go @@ -33,11 +33,11 @@ func (n *Spaceship) SetPosition(p *node.Position) node.Node { return n } -func (n *Spaceship) Comments() *[]comment.Comment { +func (n *Spaceship) Comments() []comment.Comment { return n.comments } -func (n *Spaceship) SetComments(c *[]comment.Comment) node.Node { +func (n *Spaceship) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/bitwise_not.go b/node/expr/bitwise_not.go index 9a8350a..246c8a9 100644 --- a/node/expr/bitwise_not.go +++ b/node/expr/bitwise_not.go @@ -7,7 +7,7 @@ import ( type BitwiseNot struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Expr node.Node } @@ -32,11 +32,11 @@ func (n *BitwiseNot) SetPosition(p *node.Position) node.Node { return n } -func (n *BitwiseNot) Comments() *[]comment.Comment { +func (n *BitwiseNot) Comments() []comment.Comment { return n.comments } -func (n *BitwiseNot) SetComments(c *[]comment.Comment) node.Node { +func (n *BitwiseNot) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/boolean_not.go b/node/expr/boolean_not.go index 17484c3..88a6cf3 100644 --- a/node/expr/boolean_not.go +++ b/node/expr/boolean_not.go @@ -7,7 +7,7 @@ import ( type BooleanNot struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Expr node.Node } @@ -32,11 +32,11 @@ func (n *BooleanNot) SetPosition(p *node.Position) node.Node { return n } -func (n *BooleanNot) Comments() *[]comment.Comment { +func (n *BooleanNot) Comments() []comment.Comment { return n.comments } -func (n *BooleanNot) SetComments(c *[]comment.Comment) node.Node { +func (n *BooleanNot) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/cast/cast.go b/node/expr/cast/cast.go index 12d3eb4..a9e21ee 100644 --- a/node/expr/cast/cast.go +++ b/node/expr/cast/cast.go @@ -7,6 +7,6 @@ import ( type Cast struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Expr node.Node } diff --git a/node/expr/cast/cast_array.go b/node/expr/cast/cast_array.go index 232bb83..f9fdfcd 100644 --- a/node/expr/cast/cast_array.go +++ b/node/expr/cast/cast_array.go @@ -32,11 +32,11 @@ func (n *CastArray) SetPosition(p *node.Position) node.Node { return n } -func (n *CastArray) Comments() *[]comment.Comment { +func (n *CastArray) Comments() []comment.Comment { return n.comments } -func (n *CastArray) SetComments(c *[]comment.Comment) node.Node { +func (n *CastArray) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/cast/cast_bool.go b/node/expr/cast/cast_bool.go index 4e39cc1..7d4cb53 100644 --- a/node/expr/cast/cast_bool.go +++ b/node/expr/cast/cast_bool.go @@ -32,11 +32,11 @@ func (n *CastBool) SetPosition(p *node.Position) node.Node { return n } -func (n *CastBool) Comments() *[]comment.Comment { +func (n *CastBool) Comments() []comment.Comment { return n.comments } -func (n *CastBool) SetComments(c *[]comment.Comment) node.Node { +func (n *CastBool) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/cast/cast_double.go b/node/expr/cast/cast_double.go index a64c5b1..963cf6b 100644 --- a/node/expr/cast/cast_double.go +++ b/node/expr/cast/cast_double.go @@ -32,11 +32,11 @@ func (n *CastDouble) SetPosition(p *node.Position) node.Node { return n } -func (n *CastDouble) Comments() *[]comment.Comment { +func (n *CastDouble) Comments() []comment.Comment { return n.comments } -func (n *CastDouble) SetComments(c *[]comment.Comment) node.Node { +func (n *CastDouble) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/cast/cast_int.go b/node/expr/cast/cast_int.go index 0d6492b..8bf0b89 100644 --- a/node/expr/cast/cast_int.go +++ b/node/expr/cast/cast_int.go @@ -32,11 +32,11 @@ func (n *CastInt) SetPosition(p *node.Position) node.Node { return n } -func (n *CastInt) Comments() *[]comment.Comment { +func (n *CastInt) Comments() []comment.Comment { return n.comments } -func (n *CastInt) SetComments(c *[]comment.Comment) node.Node { +func (n *CastInt) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/cast/cast_object.go b/node/expr/cast/cast_object.go index 48d6d57..9814aa1 100644 --- a/node/expr/cast/cast_object.go +++ b/node/expr/cast/cast_object.go @@ -32,11 +32,11 @@ func (n *CastObject) SetPosition(p *node.Position) node.Node { return n } -func (n *CastObject) Comments() *[]comment.Comment { +func (n *CastObject) Comments() []comment.Comment { return n.comments } -func (n *CastObject) SetComments(c *[]comment.Comment) node.Node { +func (n *CastObject) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/cast/cast_string.go b/node/expr/cast/cast_string.go index 2bfc9b9..250f081 100644 --- a/node/expr/cast/cast_string.go +++ b/node/expr/cast/cast_string.go @@ -32,11 +32,11 @@ func (n *CastString) SetPosition(p *node.Position) node.Node { return n } -func (n *CastString) Comments() *[]comment.Comment { +func (n *CastString) Comments() []comment.Comment { return n.comments } -func (n *CastString) SetComments(c *[]comment.Comment) node.Node { +func (n *CastString) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/cast/cast_unset.go b/node/expr/cast/cast_unset.go index e05eb69..64281dc 100644 --- a/node/expr/cast/cast_unset.go +++ b/node/expr/cast/cast_unset.go @@ -32,11 +32,11 @@ func (n *CastUnset) SetPosition(p *node.Position) node.Node { return n } -func (n *CastUnset) Comments() *[]comment.Comment { +func (n *CastUnset) Comments() []comment.Comment { return n.comments } -func (n *CastUnset) SetComments(c *[]comment.Comment) node.Node { +func (n *CastUnset) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/class_const_fetch.go b/node/expr/class_const_fetch.go index 63d6dac..22bd140 100644 --- a/node/expr/class_const_fetch.go +++ b/node/expr/class_const_fetch.go @@ -7,7 +7,7 @@ import ( type ClassConstFetch struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Class node.Node ConstantName node.Node } @@ -34,11 +34,11 @@ func (n *ClassConstFetch) SetPosition(p *node.Position) node.Node { return n } -func (n *ClassConstFetch) Comments() *[]comment.Comment { +func (n *ClassConstFetch) Comments() []comment.Comment { return n.comments } -func (n *ClassConstFetch) SetComments(c *[]comment.Comment) node.Node { +func (n *ClassConstFetch) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/clone.go b/node/expr/clone.go index c16186a..c207d8d 100644 --- a/node/expr/clone.go +++ b/node/expr/clone.go @@ -7,7 +7,7 @@ import ( type Clone struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Expr node.Node } @@ -32,11 +32,11 @@ func (n *Clone) SetPosition(p *node.Position) node.Node { return n } -func (n *Clone) Comments() *[]comment.Comment { +func (n *Clone) Comments() []comment.Comment { return n.comments } -func (n *Clone) SetComments(c *[]comment.Comment) node.Node { +func (n *Clone) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/closure.go b/node/expr/closure.go index 294269a..db7e917 100644 --- a/node/expr/closure.go +++ b/node/expr/closure.go @@ -7,7 +7,7 @@ import ( type Closure struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment ReturnsRef bool Static bool PhpDocComment string @@ -48,11 +48,11 @@ func (n *Closure) SetPosition(p *node.Position) node.Node { return n } -func (n *Closure) Comments() *[]comment.Comment { +func (n *Closure) Comments() []comment.Comment { return n.comments } -func (n *Closure) SetComments(c *[]comment.Comment) node.Node { +func (n *Closure) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/closure_use.go b/node/expr/closure_use.go index 2dd2fcf..136da66 100644 --- a/node/expr/closure_use.go +++ b/node/expr/closure_use.go @@ -7,7 +7,7 @@ import ( type ClusureUse struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment ByRef bool Variable node.Node } @@ -36,11 +36,11 @@ func (n *ClusureUse) SetPosition(p *node.Position) node.Node { return n } -func (n *ClusureUse) Comments() *[]comment.Comment { +func (n *ClusureUse) Comments() []comment.Comment { return n.comments } -func (n *ClusureUse) SetComments(c *[]comment.Comment) node.Node { +func (n *ClusureUse) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/const_fetch.go b/node/expr/const_fetch.go index 666c695..8e837bd 100644 --- a/node/expr/const_fetch.go +++ b/node/expr/const_fetch.go @@ -7,7 +7,7 @@ import ( type ConstFetch struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Constant node.Node } @@ -32,11 +32,11 @@ func (n *ConstFetch) SetPosition(p *node.Position) node.Node { return n } -func (n *ConstFetch) Comments() *[]comment.Comment { +func (n *ConstFetch) Comments() []comment.Comment { return n.comments } -func (n *ConstFetch) SetComments(c *[]comment.Comment) node.Node { +func (n *ConstFetch) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/empty.go b/node/expr/empty.go index 12ceda9..ae82089 100644 --- a/node/expr/empty.go +++ b/node/expr/empty.go @@ -7,7 +7,7 @@ import ( type Empty struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Expr node.Node } @@ -32,11 +32,11 @@ func (n *Empty) SetPosition(p *node.Position) node.Node { return n } -func (n *Empty) Comments() *[]comment.Comment { +func (n *Empty) Comments() []comment.Comment { return n.comments } -func (n *Empty) SetComments(c *[]comment.Comment) node.Node { +func (n *Empty) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/error_suppress.go b/node/expr/error_suppress.go index 801d32a..d2c9f08 100644 --- a/node/expr/error_suppress.go +++ b/node/expr/error_suppress.go @@ -7,7 +7,7 @@ import ( type ErrorSuppress struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Expr node.Node } @@ -32,11 +32,11 @@ func (n *ErrorSuppress) SetPosition(p *node.Position) node.Node { return n } -func (n *ErrorSuppress) Comments() *[]comment.Comment { +func (n *ErrorSuppress) Comments() []comment.Comment { return n.comments } -func (n *ErrorSuppress) SetComments(c *[]comment.Comment) node.Node { +func (n *ErrorSuppress) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/eval.go b/node/expr/eval.go index b7f790a..2c382fa 100644 --- a/node/expr/eval.go +++ b/node/expr/eval.go @@ -7,7 +7,7 @@ import ( type Eval struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Expr node.Node } @@ -32,11 +32,11 @@ func (n *Eval) SetPosition(p *node.Position) node.Node { return n } -func (n *Eval) Comments() *[]comment.Comment { +func (n *Eval) Comments() []comment.Comment { return n.comments } -func (n *Eval) SetComments(c *[]comment.Comment) node.Node { +func (n *Eval) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/exit.go b/node/expr/exit.go index ac165f8..dd989d8 100644 --- a/node/expr/exit.go +++ b/node/expr/exit.go @@ -7,7 +7,7 @@ import ( type Exit struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Expr node.Node IsDie bool } @@ -36,11 +36,11 @@ func (n *Exit) SetPosition(p *node.Position) node.Node { return n } -func (n *Exit) Comments() *[]comment.Comment { +func (n *Exit) Comments() []comment.Comment { return n.comments } -func (n *Exit) SetComments(c *[]comment.Comment) node.Node { +func (n *Exit) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/function_call.go b/node/expr/function_call.go index 09cecfd..a15e079 100644 --- a/node/expr/function_call.go +++ b/node/expr/function_call.go @@ -7,7 +7,7 @@ import ( type FunctionCall struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Function node.Node Arguments []node.Node } @@ -34,11 +34,11 @@ func (n *FunctionCall) SetPosition(p *node.Position) node.Node { return n } -func (n *FunctionCall) Comments() *[]comment.Comment { +func (n *FunctionCall) Comments() []comment.Comment { return n.comments } -func (n *FunctionCall) SetComments(c *[]comment.Comment) node.Node { +func (n *FunctionCall) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/include.go b/node/expr/include.go index e1eea1c..c8b0849 100644 --- a/node/expr/include.go +++ b/node/expr/include.go @@ -7,7 +7,7 @@ import ( type Include struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Expr node.Node } @@ -32,11 +32,11 @@ func (n *Include) SetPosition(p *node.Position) node.Node { return n } -func (n *Include) Comments() *[]comment.Comment { +func (n *Include) Comments() []comment.Comment { return n.comments } -func (n *Include) SetComments(c *[]comment.Comment) node.Node { +func (n *Include) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/include_once.go b/node/expr/include_once.go index 87b9070..605e6d0 100644 --- a/node/expr/include_once.go +++ b/node/expr/include_once.go @@ -7,7 +7,7 @@ import ( type IncludeOnce struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Expr node.Node } @@ -32,11 +32,11 @@ func (n *IncludeOnce) SetPosition(p *node.Position) node.Node { return n } -func (n *IncludeOnce) Comments() *[]comment.Comment { +func (n *IncludeOnce) Comments() []comment.Comment { return n.comments } -func (n *IncludeOnce) SetComments(c *[]comment.Comment) node.Node { +func (n *IncludeOnce) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/instance_of.go b/node/expr/instance_of.go index 3c5483a..839fe74 100644 --- a/node/expr/instance_of.go +++ b/node/expr/instance_of.go @@ -7,7 +7,7 @@ import ( type InstanceOf struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Expr node.Node Class node.Node } @@ -34,11 +34,11 @@ func (n *InstanceOf) SetPosition(p *node.Position) node.Node { return n } -func (n *InstanceOf) Comments() *[]comment.Comment { +func (n *InstanceOf) Comments() []comment.Comment { return n.comments } -func (n *InstanceOf) SetComments(c *[]comment.Comment) node.Node { +func (n *InstanceOf) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/isset.go b/node/expr/isset.go index ab5e184..e585248 100644 --- a/node/expr/isset.go +++ b/node/expr/isset.go @@ -7,7 +7,7 @@ import ( type Isset struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Variables []node.Node } @@ -32,11 +32,11 @@ func (n *Isset) SetPosition(p *node.Position) node.Node { return n } -func (n *Isset) Comments() *[]comment.Comment { +func (n *Isset) Comments() []comment.Comment { return n.comments } -func (n *Isset) SetComments(c *[]comment.Comment) node.Node { +func (n *Isset) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/list.go b/node/expr/list.go index b13da3a..4bea79f 100644 --- a/node/expr/list.go +++ b/node/expr/list.go @@ -7,7 +7,7 @@ import ( type List struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Items []node.Node } @@ -32,11 +32,11 @@ func (n *List) SetPosition(p *node.Position) node.Node { return n } -func (n *List) Comments() *[]comment.Comment { +func (n *List) Comments() []comment.Comment { return n.comments } -func (n *List) SetComments(c *[]comment.Comment) node.Node { +func (n *List) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/method_call.go b/node/expr/method_call.go index 9e24f3b..bd25bb0 100644 --- a/node/expr/method_call.go +++ b/node/expr/method_call.go @@ -7,7 +7,7 @@ import ( type MethodCall struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Variable node.Node Method node.Node Arguments []node.Node @@ -36,11 +36,11 @@ func (n *MethodCall) SetPosition(p *node.Position) node.Node { return n } -func (n *MethodCall) Comments() *[]comment.Comment { +func (n *MethodCall) Comments() []comment.Comment { return n.comments } -func (n *MethodCall) SetComments(c *[]comment.Comment) node.Node { +func (n *MethodCall) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/new.go b/node/expr/new.go index ff9ee29..d09f45b 100644 --- a/node/expr/new.go +++ b/node/expr/new.go @@ -7,7 +7,7 @@ import ( type New struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Class node.Node Arguments []node.Node } @@ -34,11 +34,11 @@ func (n *New) SetPosition(p *node.Position) node.Node { return n } -func (n *New) Comments() *[]comment.Comment { +func (n *New) Comments() []comment.Comment { return n.comments } -func (n *New) SetComments(c *[]comment.Comment) node.Node { +func (n *New) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/post_dec.go b/node/expr/post_dec.go index 6bd205b..5d12904 100644 --- a/node/expr/post_dec.go +++ b/node/expr/post_dec.go @@ -7,7 +7,7 @@ import ( type PostDec struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Variable node.Node } @@ -32,11 +32,11 @@ func (n *PostDec) SetPosition(p *node.Position) node.Node { return n } -func (n *PostDec) Comments() *[]comment.Comment { +func (n *PostDec) Comments() []comment.Comment { return n.comments } -func (n *PostDec) SetComments(c *[]comment.Comment) node.Node { +func (n *PostDec) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/post_inc.go b/node/expr/post_inc.go index 49ea872..de61e85 100644 --- a/node/expr/post_inc.go +++ b/node/expr/post_inc.go @@ -7,7 +7,7 @@ import ( type PostInc struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Variable node.Node } @@ -32,11 +32,11 @@ func (n *PostInc) SetPosition(p *node.Position) node.Node { return n } -func (n *PostInc) Comments() *[]comment.Comment { +func (n *PostInc) Comments() []comment.Comment { return n.comments } -func (n *PostInc) SetComments(c *[]comment.Comment) node.Node { +func (n *PostInc) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/pre_dec.go b/node/expr/pre_dec.go index 79c428b..e66b5fe 100644 --- a/node/expr/pre_dec.go +++ b/node/expr/pre_dec.go @@ -7,7 +7,7 @@ import ( type PreDec struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Variable node.Node } @@ -32,11 +32,11 @@ func (n *PreDec) SetPosition(p *node.Position) node.Node { return n } -func (n *PreDec) Comments() *[]comment.Comment { +func (n *PreDec) Comments() []comment.Comment { return n.comments } -func (n *PreDec) SetComments(c *[]comment.Comment) node.Node { +func (n *PreDec) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/pre_inc.go b/node/expr/pre_inc.go index 5a71c23..8575f5e 100644 --- a/node/expr/pre_inc.go +++ b/node/expr/pre_inc.go @@ -7,7 +7,7 @@ import ( type PreInc struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Variable node.Node } @@ -32,11 +32,11 @@ func (n *PreInc) SetPosition(p *node.Position) node.Node { return n } -func (n *PreInc) Comments() *[]comment.Comment { +func (n *PreInc) Comments() []comment.Comment { return n.comments } -func (n *PreInc) SetComments(c *[]comment.Comment) node.Node { +func (n *PreInc) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/print.go b/node/expr/print.go index a86692a..e479636 100644 --- a/node/expr/print.go +++ b/node/expr/print.go @@ -7,7 +7,7 @@ import ( type Print struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Expr node.Node } @@ -32,11 +32,11 @@ func (n *Print) SetPosition(p *node.Position) node.Node { return n } -func (n *Print) Comments() *[]comment.Comment { +func (n *Print) Comments() []comment.Comment { return n.comments } -func (n *Print) SetComments(c *[]comment.Comment) node.Node { +func (n *Print) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/property_fetch.go b/node/expr/property_fetch.go index 0f1e5e7..6077947 100644 --- a/node/expr/property_fetch.go +++ b/node/expr/property_fetch.go @@ -7,7 +7,7 @@ import ( type PropertyFetch struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Variable node.Node Property node.Node } @@ -34,11 +34,11 @@ func (n *PropertyFetch) SetPosition(p *node.Position) node.Node { return n } -func (n *PropertyFetch) Comments() *[]comment.Comment { +func (n *PropertyFetch) Comments() []comment.Comment { return n.comments } -func (n *PropertyFetch) SetComments(c *[]comment.Comment) node.Node { +func (n *PropertyFetch) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/require.go b/node/expr/require.go index a679d3b..931c3af 100644 --- a/node/expr/require.go +++ b/node/expr/require.go @@ -7,7 +7,7 @@ import ( type Require struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Expr node.Node } @@ -32,11 +32,11 @@ func (n *Require) SetPosition(p *node.Position) node.Node { return n } -func (n *Require) Comments() *[]comment.Comment { +func (n *Require) Comments() []comment.Comment { return n.comments } -func (n *Require) SetComments(c *[]comment.Comment) node.Node { +func (n *Require) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/require_once.go b/node/expr/require_once.go index 163e3d5..383ffa6 100644 --- a/node/expr/require_once.go +++ b/node/expr/require_once.go @@ -7,7 +7,7 @@ import ( type RequireOnce struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Expr node.Node } @@ -32,11 +32,11 @@ func (n *RequireOnce) SetPosition(p *node.Position) node.Node { return n } -func (n *RequireOnce) Comments() *[]comment.Comment { +func (n *RequireOnce) Comments() []comment.Comment { return n.comments } -func (n *RequireOnce) SetComments(c *[]comment.Comment) node.Node { +func (n *RequireOnce) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/shell_exec.go b/node/expr/shell_exec.go index 240beb6..467d7d3 100644 --- a/node/expr/shell_exec.go +++ b/node/expr/shell_exec.go @@ -7,7 +7,7 @@ import ( type ShellExec struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Parts []node.Node } @@ -32,11 +32,11 @@ func (n *ShellExec) SetPosition(p *node.Position) node.Node { return n } -func (n *ShellExec) Comments() *[]comment.Comment { +func (n *ShellExec) Comments() []comment.Comment { return n.comments } -func (n *ShellExec) SetComments(c *[]comment.Comment) node.Node { +func (n *ShellExec) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/short_array.go b/node/expr/short_array.go index ecf7a0b..3e3c312 100644 --- a/node/expr/short_array.go +++ b/node/expr/short_array.go @@ -7,7 +7,7 @@ import ( type ShortArray struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Items []node.Node } @@ -32,11 +32,11 @@ func (n *ShortArray) SetPosition(p *node.Position) node.Node { return n } -func (n *ShortArray) Comments() *[]comment.Comment { +func (n *ShortArray) Comments() []comment.Comment { return n.comments } -func (n *ShortArray) SetComments(c *[]comment.Comment) node.Node { +func (n *ShortArray) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/short_list.go b/node/expr/short_list.go index 153de09..3a8598a 100644 --- a/node/expr/short_list.go +++ b/node/expr/short_list.go @@ -7,7 +7,7 @@ import ( type ShortList struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Items []node.Node } @@ -32,11 +32,11 @@ func (n *ShortList) SetPosition(p *node.Position) node.Node { return n } -func (n *ShortList) Comments() *[]comment.Comment { +func (n *ShortList) Comments() []comment.Comment { return n.comments } -func (n *ShortList) SetComments(c *[]comment.Comment) node.Node { +func (n *ShortList) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/static_call.go b/node/expr/static_call.go index 3ca1cd7..c6a9df8 100644 --- a/node/expr/static_call.go +++ b/node/expr/static_call.go @@ -7,7 +7,7 @@ import ( type StaticCall struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Class node.Node Call node.Node Arguments []node.Node @@ -36,11 +36,11 @@ func (n *StaticCall) SetPosition(p *node.Position) node.Node { return n } -func (n *StaticCall) Comments() *[]comment.Comment { +func (n *StaticCall) Comments() []comment.Comment { return n.comments } -func (n *StaticCall) SetComments(c *[]comment.Comment) node.Node { +func (n *StaticCall) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/static_property_fetch.go b/node/expr/static_property_fetch.go index 3e9fdf0..6e8a7ae 100644 --- a/node/expr/static_property_fetch.go +++ b/node/expr/static_property_fetch.go @@ -7,7 +7,7 @@ import ( type StaticPropertyFetch struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Class node.Node Property node.Node } @@ -34,11 +34,11 @@ func (n *StaticPropertyFetch) SetPosition(p *node.Position) node.Node { return n } -func (n *StaticPropertyFetch) Comments() *[]comment.Comment { +func (n *StaticPropertyFetch) Comments() []comment.Comment { return n.comments } -func (n *StaticPropertyFetch) SetComments(c *[]comment.Comment) node.Node { +func (n *StaticPropertyFetch) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/ternary.go b/node/expr/ternary.go index 69dbde9..fe8a102 100644 --- a/node/expr/ternary.go +++ b/node/expr/ternary.go @@ -7,7 +7,7 @@ import ( type Ternary struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Condition node.Node IfTrue node.Node IfFalse node.Node @@ -36,11 +36,11 @@ func (n *Ternary) SetPosition(p *node.Position) node.Node { return n } -func (n *Ternary) Comments() *[]comment.Comment { +func (n *Ternary) Comments() []comment.Comment { return n.comments } -func (n *Ternary) SetComments(c *[]comment.Comment) node.Node { +func (n *Ternary) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/unary_minus.go b/node/expr/unary_minus.go index 1a226bc..d349b76 100644 --- a/node/expr/unary_minus.go +++ b/node/expr/unary_minus.go @@ -7,7 +7,7 @@ import ( type UnaryMinus struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Expr node.Node } @@ -32,11 +32,11 @@ func (n *UnaryMinus) SetPosition(p *node.Position) node.Node { return n } -func (n *UnaryMinus) Comments() *[]comment.Comment { +func (n *UnaryMinus) Comments() []comment.Comment { return n.comments } -func (n *UnaryMinus) SetComments(c *[]comment.Comment) node.Node { +func (n *UnaryMinus) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/unary_plus.go b/node/expr/unary_plus.go index fbd97b2..c56606c 100644 --- a/node/expr/unary_plus.go +++ b/node/expr/unary_plus.go @@ -7,7 +7,7 @@ import ( type UnaryPlus struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Expr node.Node } @@ -32,11 +32,11 @@ func (n *UnaryPlus) SetPosition(p *node.Position) node.Node { return n } -func (n *UnaryPlus) Comments() *[]comment.Comment { +func (n *UnaryPlus) Comments() []comment.Comment { return n.comments } -func (n *UnaryPlus) SetComments(c *[]comment.Comment) node.Node { +func (n *UnaryPlus) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/variable.go b/node/expr/variable.go index 465ea1f..6e60063 100644 --- a/node/expr/variable.go +++ b/node/expr/variable.go @@ -7,7 +7,7 @@ import ( type Variable struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment VarName node.Node } @@ -32,11 +32,11 @@ func (n *Variable) SetPosition(p *node.Position) node.Node { return n } -func (n *Variable) Comments() *[]comment.Comment { +func (n *Variable) Comments() []comment.Comment { return n.comments } -func (n *Variable) SetComments(c *[]comment.Comment) node.Node { +func (n *Variable) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/yield.go b/node/expr/yield.go index 2b7a931..8a7b71e 100644 --- a/node/expr/yield.go +++ b/node/expr/yield.go @@ -7,7 +7,7 @@ import ( type Yield struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Key node.Node Value node.Node } @@ -34,11 +34,11 @@ func (n *Yield) SetPosition(p *node.Position) node.Node { return n } -func (n *Yield) Comments() *[]comment.Comment { +func (n *Yield) Comments() []comment.Comment { return n.comments } -func (n *Yield) SetComments(c *[]comment.Comment) node.Node { +func (n *Yield) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/expr/yield_from.go b/node/expr/yield_from.go index e90b57b..79ae29d 100644 --- a/node/expr/yield_from.go +++ b/node/expr/yield_from.go @@ -7,7 +7,7 @@ import ( type YieldFrom struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Expr node.Node } @@ -32,11 +32,11 @@ func (n *YieldFrom) SetPosition(p *node.Position) node.Node { return n } -func (n *YieldFrom) Comments() *[]comment.Comment { +func (n *YieldFrom) Comments() []comment.Comment { return n.comments } -func (n *YieldFrom) SetComments(c *[]comment.Comment) node.Node { +func (n *YieldFrom) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/identifier.go b/node/identifier.go index 6557524..1ee4483 100644 --- a/node/identifier.go +++ b/node/identifier.go @@ -4,7 +4,7 @@ import "github.com/z7zmey/php-parser/comment" type Identifier struct { position *Position - comments *[]comment.Comment + comments []comment.Comment Value string } @@ -31,11 +31,11 @@ func (n *Identifier) SetPosition(p *Position) Node { return n } -func (n *Identifier) Comments() *[]comment.Comment { +func (n *Identifier) Comments() []comment.Comment { return n.comments } -func (n *Identifier) SetComments(c *[]comment.Comment) Node { +func (n *Identifier) SetComments(c []comment.Comment) Node { n.comments = c return n } diff --git a/node/name/name.go b/node/name/name.go index 8c79a43..2305c4a 100644 --- a/node/name/name.go +++ b/node/name/name.go @@ -7,7 +7,7 @@ import ( type Name struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Parts []node.Node } @@ -32,11 +32,11 @@ func (n *Name) SetPosition(p *node.Position) node.Node { return n } -func (n *Name) Comments() *[]comment.Comment { +func (n *Name) Comments() []comment.Comment { return n.comments } -func (n *Name) SetComments(c *[]comment.Comment) node.Node { +func (n *Name) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/name/name_part.go b/node/name/name_part.go index 8705444..31f05df 100644 --- a/node/name/name_part.go +++ b/node/name/name_part.go @@ -7,7 +7,7 @@ import ( type NamePart struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Value string } @@ -34,11 +34,11 @@ func (n *NamePart) SetPosition(p *node.Position) node.Node { return n } -func (n *NamePart) Comments() *[]comment.Comment { +func (n *NamePart) Comments() []comment.Comment { return n.comments } -func (n *NamePart) SetComments(c *[]comment.Comment) node.Node { +func (n *NamePart) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/node.go b/node/node.go index 3b7aaa0..9801848 100644 --- a/node/node.go +++ b/node/node.go @@ -11,8 +11,8 @@ type Node interface { } type Commenter interface { - Comments() *[]comment.Comment - SetComments(*[]comment.Comment) Node + Comments() []comment.Comment + SetComments([]comment.Comment) Node } type Positioner interface { diff --git a/node/nullable.go b/node/nullable.go index c024b7b..9865282 100644 --- a/node/nullable.go +++ b/node/nullable.go @@ -4,7 +4,7 @@ import "github.com/z7zmey/php-parser/comment" type Nullable struct { position *Position - comments *[]comment.Comment + comments []comment.Comment Expr Node } @@ -29,11 +29,11 @@ func (n *Nullable) SetPosition(p *Position) Node { return n } -func (n *Nullable) Comments() *[]comment.Comment { +func (n *Nullable) Comments() []comment.Comment { return n.comments } -func (n *Nullable) SetComments(c *[]comment.Comment) Node { +func (n *Nullable) SetComments(c []comment.Comment) Node { n.comments = c return n } diff --git a/node/parameter.go b/node/parameter.go index a9426ac..a37911c 100644 --- a/node/parameter.go +++ b/node/parameter.go @@ -4,7 +4,7 @@ import "github.com/z7zmey/php-parser/comment" type Parameter struct { position *Position - comments *[]comment.Comment + comments []comment.Comment ByRef bool Variadic bool VariableType Node @@ -40,11 +40,11 @@ func (n *Parameter) SetPosition(p *Position) Node { return n } -func (n *Parameter) Comments() *[]comment.Comment { +func (n *Parameter) Comments() []comment.Comment { return n.comments } -func (n *Parameter) SetComments(c *[]comment.Comment) Node { +func (n *Parameter) SetComments(c []comment.Comment) Node { n.comments = c return n } diff --git a/node/scalar/dnumber.go b/node/scalar/dnumber.go index ecfc5a9..0f47576 100644 --- a/node/scalar/dnumber.go +++ b/node/scalar/dnumber.go @@ -7,7 +7,7 @@ import ( type Dnumber struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Value string } @@ -34,11 +34,11 @@ func (n *Dnumber) SetPosition(p *node.Position) node.Node { return n } -func (n *Dnumber) Comments() *[]comment.Comment { +func (n *Dnumber) Comments() []comment.Comment { return n.comments } -func (n *Dnumber) SetComments(c *[]comment.Comment) node.Node { +func (n *Dnumber) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/scalar/encapsed.go b/node/scalar/encapsed.go index b181ca2..eb3b86d 100644 --- a/node/scalar/encapsed.go +++ b/node/scalar/encapsed.go @@ -7,7 +7,7 @@ import ( type Encapsed struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Parts []node.Node } @@ -32,11 +32,11 @@ func (n *Encapsed) SetPosition(p *node.Position) node.Node { return n } -func (n *Encapsed) Comments() *[]comment.Comment { +func (n *Encapsed) Comments() []comment.Comment { return n.comments } -func (n *Encapsed) SetComments(c *[]comment.Comment) node.Node { +func (n *Encapsed) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/scalar/encapsed_string_part.go b/node/scalar/encapsed_string_part.go index 979d434..cad6f3e 100644 --- a/node/scalar/encapsed_string_part.go +++ b/node/scalar/encapsed_string_part.go @@ -7,7 +7,7 @@ import ( type EncapsedStringPart struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Value string } @@ -34,11 +34,11 @@ func (n *EncapsedStringPart) SetPosition(p *node.Position) node.Node { return n } -func (n *EncapsedStringPart) Comments() *[]comment.Comment { +func (n *EncapsedStringPart) Comments() []comment.Comment { return n.comments } -func (n *EncapsedStringPart) SetComments(c *[]comment.Comment) node.Node { +func (n *EncapsedStringPart) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/scalar/lnumber.go b/node/scalar/lnumber.go index 7bf9adc..6609fb8 100644 --- a/node/scalar/lnumber.go +++ b/node/scalar/lnumber.go @@ -7,7 +7,7 @@ import ( type Lnumber struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Value string } @@ -34,11 +34,11 @@ func (n *Lnumber) SetPosition(p *node.Position) node.Node { return n } -func (n *Lnumber) Comments() *[]comment.Comment { +func (n *Lnumber) Comments() []comment.Comment { return n.comments } -func (n *Lnumber) SetComments(c *[]comment.Comment) node.Node { +func (n *Lnumber) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/scalar/magic_constant.go b/node/scalar/magic_constant.go index 4928bc8..b27fbb2 100644 --- a/node/scalar/magic_constant.go +++ b/node/scalar/magic_constant.go @@ -7,7 +7,7 @@ import ( type MagicConstant struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Value string } @@ -34,11 +34,11 @@ func (n *MagicConstant) SetPosition(p *node.Position) node.Node { return n } -func (n *MagicConstant) Comments() *[]comment.Comment { +func (n *MagicConstant) Comments() []comment.Comment { return n.comments } -func (n *MagicConstant) SetComments(c *[]comment.Comment) node.Node { +func (n *MagicConstant) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/scalar/string.go b/node/scalar/string.go index 2aab381..21c6abe 100644 --- a/node/scalar/string.go +++ b/node/scalar/string.go @@ -7,7 +7,7 @@ import ( type String struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Value string } @@ -34,11 +34,11 @@ func (n *String) SetPosition(p *node.Position) node.Node { return n } -func (n *String) Comments() *[]comment.Comment { +func (n *String) Comments() []comment.Comment { return n.comments } -func (n *String) SetComments(c *[]comment.Comment) node.Node { +func (n *String) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/alt_else.go b/node/stmt/alt_else.go index a7108f9..e78f243 100644 --- a/node/stmt/alt_else.go +++ b/node/stmt/alt_else.go @@ -7,7 +7,7 @@ import ( type AltElse struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Stmt node.Node } @@ -32,11 +32,11 @@ func (n *AltElse) SetPosition(p *node.Position) node.Node { return n } -func (n *AltElse) Comments() *[]comment.Comment { +func (n *AltElse) Comments() []comment.Comment { return n.comments } -func (n *AltElse) SetComments(c *[]comment.Comment) node.Node { +func (n *AltElse) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/alt_else_if.go b/node/stmt/alt_else_if.go index 53f971b..ff47d09 100644 --- a/node/stmt/alt_else_if.go +++ b/node/stmt/alt_else_if.go @@ -7,7 +7,7 @@ import ( type AltElseIf struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Cond node.Node Stmt node.Node } @@ -34,11 +34,11 @@ func (n *AltElseIf) SetPosition(p *node.Position) node.Node { return n } -func (n *AltElseIf) Comments() *[]comment.Comment { +func (n *AltElseIf) Comments() []comment.Comment { return n.comments } -func (n *AltElseIf) SetComments(c *[]comment.Comment) node.Node { +func (n *AltElseIf) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/alt_if.go b/node/stmt/alt_if.go index c5130a6..1d34ebc 100644 --- a/node/stmt/alt_if.go +++ b/node/stmt/alt_if.go @@ -7,7 +7,7 @@ import ( type AltIf struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Cond node.Node Stmt node.Node ElseIf []node.Node @@ -38,11 +38,11 @@ func (n *AltIf) SetPosition(p *node.Position) node.Node { return n } -func (n *AltIf) Comments() *[]comment.Comment { +func (n *AltIf) Comments() []comment.Comment { return n.comments } -func (n *AltIf) SetComments(c *[]comment.Comment) node.Node { +func (n *AltIf) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/break.go b/node/stmt/break.go index 743850e..5efef6d 100644 --- a/node/stmt/break.go +++ b/node/stmt/break.go @@ -7,7 +7,7 @@ import ( type Break struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Expr node.Node } @@ -32,11 +32,11 @@ func (n *Break) SetPosition(p *node.Position) node.Node { return n } -func (n *Break) Comments() *[]comment.Comment { +func (n *Break) Comments() []comment.Comment { return n.comments } -func (n *Break) SetComments(c *[]comment.Comment) node.Node { +func (n *Break) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/case.go b/node/stmt/case.go index c50f1a7..73ea4d2 100644 --- a/node/stmt/case.go +++ b/node/stmt/case.go @@ -7,7 +7,7 @@ import ( type Case struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Cond node.Node Stmts []node.Node } @@ -34,11 +34,11 @@ func (n *Case) SetPosition(p *node.Position) node.Node { return n } -func (n *Case) Comments() *[]comment.Comment { +func (n *Case) Comments() []comment.Comment { return n.comments } -func (n *Case) SetComments(c *[]comment.Comment) node.Node { +func (n *Case) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/catch.go b/node/stmt/catch.go index bbc0b38..41ba70f 100644 --- a/node/stmt/catch.go +++ b/node/stmt/catch.go @@ -7,7 +7,7 @@ import ( type Catch struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Types []node.Node Variable node.Node Stmts []node.Node @@ -36,11 +36,11 @@ func (n *Catch) SetPosition(p *node.Position) node.Node { return n } -func (n *Catch) Comments() *[]comment.Comment { +func (n *Catch) Comments() []comment.Comment { return n.comments } -func (n *Catch) SetComments(c *[]comment.Comment) node.Node { +func (n *Catch) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/class.go b/node/stmt/class.go index 9ec6e12..289f44f 100644 --- a/node/stmt/class.go +++ b/node/stmt/class.go @@ -7,7 +7,7 @@ import ( type Class struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment PhpDocComment string ClassName node.Node Modifiers []node.Node @@ -46,11 +46,11 @@ func (n *Class) SetPosition(p *node.Position) node.Node { return n } -func (n *Class) Comments() *[]comment.Comment { +func (n *Class) Comments() []comment.Comment { return n.comments } -func (n *Class) SetComments(c *[]comment.Comment) node.Node { +func (n *Class) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/class_const_list.go b/node/stmt/class_const_list.go index 770eb80..4a4baf0 100644 --- a/node/stmt/class_const_list.go +++ b/node/stmt/class_const_list.go @@ -7,7 +7,7 @@ import ( type ClassConstList struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Modifiers []node.Node Consts []node.Node } @@ -34,11 +34,11 @@ func (n *ClassConstList) SetPosition(p *node.Position) node.Node { return n } -func (n *ClassConstList) Comments() *[]comment.Comment { +func (n *ClassConstList) Comments() []comment.Comment { return n.comments } -func (n *ClassConstList) SetComments(c *[]comment.Comment) node.Node { +func (n *ClassConstList) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/class_method.go b/node/stmt/class_method.go index 556b05e..214e418 100644 --- a/node/stmt/class_method.go +++ b/node/stmt/class_method.go @@ -7,7 +7,7 @@ import ( type ClassMethod struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment ReturnsRef bool PhpDocComment string MethodName node.Node @@ -47,11 +47,11 @@ func (n *ClassMethod) SetPosition(p *node.Position) node.Node { return n } -func (n *ClassMethod) Comments() *[]comment.Comment { +func (n *ClassMethod) Comments() []comment.Comment { return n.comments } -func (n *ClassMethod) SetComments(c *[]comment.Comment) node.Node { +func (n *ClassMethod) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/const_list.go b/node/stmt/const_list.go index 39d68ef..316a569 100644 --- a/node/stmt/const_list.go +++ b/node/stmt/const_list.go @@ -7,7 +7,7 @@ import ( type ConstList struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Consts []node.Node } @@ -32,11 +32,11 @@ func (n *ConstList) SetPosition(p *node.Position) node.Node { return n } -func (n *ConstList) Comments() *[]comment.Comment { +func (n *ConstList) Comments() []comment.Comment { return n.comments } -func (n *ConstList) SetComments(c *[]comment.Comment) node.Node { +func (n *ConstList) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/constant.go b/node/stmt/constant.go index 6d78f35..254deb0 100644 --- a/node/stmt/constant.go +++ b/node/stmt/constant.go @@ -7,7 +7,7 @@ import ( type Constant struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment PhpDocComment string ConstantName node.Node Expr node.Node @@ -38,11 +38,11 @@ func (n *Constant) SetPosition(p *node.Position) node.Node { return n } -func (n *Constant) Comments() *[]comment.Comment { +func (n *Constant) Comments() []comment.Comment { return n.comments } -func (n *Constant) SetComments(c *[]comment.Comment) node.Node { +func (n *Constant) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/continue.go b/node/stmt/continue.go index 42ae06e..1323018 100644 --- a/node/stmt/continue.go +++ b/node/stmt/continue.go @@ -7,7 +7,7 @@ import ( type Continue struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Expr node.Node } @@ -32,11 +32,11 @@ func (n *Continue) SetPosition(p *node.Position) node.Node { return n } -func (n *Continue) Comments() *[]comment.Comment { +func (n *Continue) Comments() []comment.Comment { return n.comments } -func (n *Continue) SetComments(c *[]comment.Comment) node.Node { +func (n *Continue) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/declare.go b/node/stmt/declare.go index f668cd4..4b192e7 100644 --- a/node/stmt/declare.go +++ b/node/stmt/declare.go @@ -7,7 +7,7 @@ import ( type Declare struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Consts []node.Node Stmt node.Node } @@ -34,11 +34,11 @@ func (n *Declare) SetPosition(p *node.Position) node.Node { return n } -func (n *Declare) Comments() *[]comment.Comment { +func (n *Declare) Comments() []comment.Comment { return n.comments } -func (n *Declare) SetComments(c *[]comment.Comment) node.Node { +func (n *Declare) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/default.go b/node/stmt/default.go index 61d6249..300548c 100644 --- a/node/stmt/default.go +++ b/node/stmt/default.go @@ -7,7 +7,7 @@ import ( type Default struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Stmts []node.Node } @@ -32,11 +32,11 @@ func (n *Default) SetPosition(p *node.Position) node.Node { return n } -func (n *Default) Comments() *[]comment.Comment { +func (n *Default) Comments() []comment.Comment { return n.comments } -func (n *Default) SetComments(c *[]comment.Comment) node.Node { +func (n *Default) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/do.go b/node/stmt/do.go index e9150e8..959b60e 100644 --- a/node/stmt/do.go +++ b/node/stmt/do.go @@ -7,7 +7,7 @@ import ( type Do struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Stmt node.Node Cond node.Node } @@ -34,11 +34,11 @@ func (n *Do) SetPosition(p *node.Position) node.Node { return n } -func (n *Do) Comments() *[]comment.Comment { +func (n *Do) Comments() []comment.Comment { return n.comments } -func (n *Do) SetComments(c *[]comment.Comment) node.Node { +func (n *Do) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/echo.go b/node/stmt/echo.go index 9204a78..3e00e4b 100644 --- a/node/stmt/echo.go +++ b/node/stmt/echo.go @@ -7,7 +7,7 @@ import ( type Echo struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Exprs []node.Node } @@ -32,11 +32,11 @@ func (n *Echo) SetPosition(p *node.Position) node.Node { return n } -func (n *Echo) Comments() *[]comment.Comment { +func (n *Echo) Comments() []comment.Comment { return n.comments } -func (n *Echo) SetComments(c *[]comment.Comment) node.Node { +func (n *Echo) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/else.go b/node/stmt/else.go index 93e03c6..5bbebff 100644 --- a/node/stmt/else.go +++ b/node/stmt/else.go @@ -7,7 +7,7 @@ import ( type Else struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Stmt node.Node } @@ -32,11 +32,11 @@ func (n *Else) SetPosition(p *node.Position) node.Node { return n } -func (n *Else) Comments() *[]comment.Comment { +func (n *Else) Comments() []comment.Comment { return n.comments } -func (n *Else) SetComments(c *[]comment.Comment) node.Node { +func (n *Else) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/else_if.go b/node/stmt/else_if.go index 0f1ad5b..b7e559b 100644 --- a/node/stmt/else_if.go +++ b/node/stmt/else_if.go @@ -7,7 +7,7 @@ import ( type ElseIf struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Cond node.Node Stmt node.Node } @@ -34,11 +34,11 @@ func (n *ElseIf) SetPosition(p *node.Position) node.Node { return n } -func (n *ElseIf) Comments() *[]comment.Comment { +func (n *ElseIf) Comments() []comment.Comment { return n.comments } -func (n *ElseIf) SetComments(c *[]comment.Comment) node.Node { +func (n *ElseIf) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/expression.go b/node/stmt/expression.go index b404eb0..8abba0a 100644 --- a/node/stmt/expression.go +++ b/node/stmt/expression.go @@ -7,7 +7,7 @@ import ( type Expression struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Expr node.Node } @@ -32,11 +32,11 @@ func (n *Expression) SetPosition(p *node.Position) node.Node { return n } -func (n *Expression) Comments() *[]comment.Comment { +func (n *Expression) Comments() []comment.Comment { return n.comments } -func (n *Expression) SetComments(c *[]comment.Comment) node.Node { +func (n *Expression) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/finally.go b/node/stmt/finally.go index a067f53..31c1fbe 100644 --- a/node/stmt/finally.go +++ b/node/stmt/finally.go @@ -7,7 +7,7 @@ import ( type Finally struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Stmts []node.Node } @@ -32,11 +32,11 @@ func (n *Finally) SetPosition(p *node.Position) node.Node { return n } -func (n *Finally) Comments() *[]comment.Comment { +func (n *Finally) Comments() []comment.Comment { return n.comments } -func (n *Finally) SetComments(c *[]comment.Comment) node.Node { +func (n *Finally) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/for.go b/node/stmt/for.go index 8618a20..736b14b 100644 --- a/node/stmt/for.go +++ b/node/stmt/for.go @@ -7,7 +7,7 @@ import ( type For struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Init []node.Node Cond []node.Node Loop []node.Node @@ -38,11 +38,11 @@ func (n *For) SetPosition(p *node.Position) node.Node { return n } -func (n *For) Comments() *[]comment.Comment { +func (n *For) Comments() []comment.Comment { return n.comments } -func (n *For) SetComments(c *[]comment.Comment) node.Node { +func (n *For) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/foreach.go b/node/stmt/foreach.go index d5b8452..fe1bdf7 100644 --- a/node/stmt/foreach.go +++ b/node/stmt/foreach.go @@ -7,7 +7,7 @@ import ( type Foreach struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment ByRef bool Expr node.Node Key node.Node @@ -42,11 +42,11 @@ func (n *Foreach) SetPosition(p *node.Position) node.Node { return n } -func (n *Foreach) Comments() *[]comment.Comment { +func (n *Foreach) Comments() []comment.Comment { return n.comments } -func (n *Foreach) SetComments(c *[]comment.Comment) node.Node { +func (n *Foreach) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/function.go b/node/stmt/function.go index 292725d..87b8476 100644 --- a/node/stmt/function.go +++ b/node/stmt/function.go @@ -7,7 +7,7 @@ import ( type Function struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment ReturnsRef bool PhpDocComment string FunctionName node.Node @@ -46,11 +46,11 @@ func (n *Function) SetPosition(p *node.Position) node.Node { return n } -func (n *Function) Comments() *[]comment.Comment { +func (n *Function) Comments() []comment.Comment { return n.comments } -func (n *Function) SetComments(c *[]comment.Comment) node.Node { +func (n *Function) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/global.go b/node/stmt/global.go index 22c0e2e..8cd38d2 100644 --- a/node/stmt/global.go +++ b/node/stmt/global.go @@ -7,7 +7,7 @@ import ( type Global struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Vars []node.Node } @@ -32,11 +32,11 @@ func (n *Global) SetPosition(p *node.Position) node.Node { return n } -func (n *Global) Comments() *[]comment.Comment { +func (n *Global) Comments() []comment.Comment { return n.comments } -func (n *Global) SetComments(c *[]comment.Comment) node.Node { +func (n *Global) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/goto.go b/node/stmt/goto.go index de8efaa..83f6dba 100644 --- a/node/stmt/goto.go +++ b/node/stmt/goto.go @@ -7,7 +7,7 @@ import ( type Goto struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Label node.Node } @@ -32,11 +32,11 @@ func (n *Goto) SetPosition(p *node.Position) node.Node { return n } -func (n *Goto) Comments() *[]comment.Comment { +func (n *Goto) Comments() []comment.Comment { return n.comments } -func (n *Goto) SetComments(c *[]comment.Comment) node.Node { +func (n *Goto) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/group_use.go b/node/stmt/group_use.go index 2c50265..ea12401 100644 --- a/node/stmt/group_use.go +++ b/node/stmt/group_use.go @@ -7,7 +7,7 @@ import ( type GroupUse struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment UseType node.Node pRefix node.Node UseList []node.Node @@ -36,11 +36,11 @@ func (n *GroupUse) SetPosition(p *node.Position) node.Node { return n } -func (n *GroupUse) Comments() *[]comment.Comment { +func (n *GroupUse) Comments() []comment.Comment { return n.comments } -func (n *GroupUse) SetComments(c *[]comment.Comment) node.Node { +func (n *GroupUse) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/halt_compiler.go b/node/stmt/halt_compiler.go index b5fe811..609b4c0 100644 --- a/node/stmt/halt_compiler.go +++ b/node/stmt/halt_compiler.go @@ -7,7 +7,7 @@ import ( type HaltCompiler struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment } func NewHaltCompiler() *HaltCompiler { @@ -30,11 +30,11 @@ func (n *HaltCompiler) SetPosition(p *node.Position) node.Node { return n } -func (n *HaltCompiler) Comments() *[]comment.Comment { +func (n *HaltCompiler) Comments() []comment.Comment { return n.comments } -func (n *HaltCompiler) SetComments(c *[]comment.Comment) node.Node { +func (n *HaltCompiler) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/if.go b/node/stmt/if.go index d6bda30..bbfc75d 100644 --- a/node/stmt/if.go +++ b/node/stmt/if.go @@ -7,7 +7,7 @@ import ( type If struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Cond node.Node Stmt node.Node ElseIf []node.Node @@ -38,11 +38,11 @@ func (n *If) SetPosition(p *node.Position) node.Node { return n } -func (n *If) Comments() *[]comment.Comment { +func (n *If) Comments() []comment.Comment { return n.comments } -func (n *If) SetComments(c *[]comment.Comment) node.Node { +func (n *If) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/inline_html.go b/node/stmt/inline_html.go index 59e5fd1..27fd035 100644 --- a/node/stmt/inline_html.go +++ b/node/stmt/inline_html.go @@ -7,7 +7,7 @@ import ( type InlineHtml struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Value string } @@ -34,11 +34,11 @@ func (n *InlineHtml) SetPosition(p *node.Position) node.Node { return n } -func (n *InlineHtml) Comments() *[]comment.Comment { +func (n *InlineHtml) Comments() []comment.Comment { return n.comments } -func (n *InlineHtml) SetComments(c *[]comment.Comment) node.Node { +func (n *InlineHtml) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/interface.go b/node/stmt/interface.go index 50b4d96..a198e18 100644 --- a/node/stmt/interface.go +++ b/node/stmt/interface.go @@ -7,7 +7,7 @@ import ( type Interface struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment PhpDocComment string InterfaceName node.Node Extends []node.Node @@ -40,11 +40,11 @@ func (n *Interface) SetPosition(p *node.Position) node.Node { return n } -func (n *Interface) Comments() *[]comment.Comment { +func (n *Interface) Comments() []comment.Comment { return n.comments } -func (n *Interface) SetComments(c *[]comment.Comment) node.Node { +func (n *Interface) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/label.go b/node/stmt/label.go index eedeaa1..64a53e6 100644 --- a/node/stmt/label.go +++ b/node/stmt/label.go @@ -7,7 +7,7 @@ import ( type Label struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment LabelName node.Node } @@ -32,11 +32,11 @@ func (n *Label) SetPosition(p *node.Position) node.Node { return n } -func (n *Label) Comments() *[]comment.Comment { +func (n *Label) Comments() []comment.Comment { return n.comments } -func (n *Label) SetComments(c *[]comment.Comment) node.Node { +func (n *Label) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/namespace.go b/node/stmt/namespace.go index 6a891fc..e4272ff 100644 --- a/node/stmt/namespace.go +++ b/node/stmt/namespace.go @@ -7,7 +7,7 @@ import ( type Namespace struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment NamespaceName node.Node Stmts []node.Node } @@ -34,11 +34,11 @@ func (n *Namespace) SetPosition(p *node.Position) node.Node { return n } -func (n *Namespace) Comments() *[]comment.Comment { +func (n *Namespace) Comments() []comment.Comment { return n.comments } -func (n *Namespace) SetComments(c *[]comment.Comment) node.Node { +func (n *Namespace) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/nop.go b/node/stmt/nop.go index ab54781..bc1a63d 100644 --- a/node/stmt/nop.go +++ b/node/stmt/nop.go @@ -7,7 +7,7 @@ import ( type Nop struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment } func NewNop() *Nop { @@ -30,11 +30,11 @@ func (n *Nop) SetPosition(p *node.Position) node.Node { return n } -func (n *Nop) Comments() *[]comment.Comment { +func (n *Nop) Comments() []comment.Comment { return n.comments } -func (n *Nop) SetComments(c *[]comment.Comment) node.Node { +func (n *Nop) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/property.go b/node/stmt/property.go index 452bd57..6cd6c8c 100644 --- a/node/stmt/property.go +++ b/node/stmt/property.go @@ -7,7 +7,7 @@ import ( type Property struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment PhpDocComment string Variable node.Node Expr node.Node @@ -37,11 +37,11 @@ func (n *Property) SetPosition(p *node.Position) node.Node { return n } -func (n *Property) Comments() *[]comment.Comment { +func (n *Property) Comments() []comment.Comment { return n.comments } -func (n *Property) SetComments(c *[]comment.Comment) node.Node { +func (n *Property) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/property_list.go b/node/stmt/property_list.go index 95571fd..7c97701 100644 --- a/node/stmt/property_list.go +++ b/node/stmt/property_list.go @@ -7,7 +7,7 @@ import ( type PropertyList struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Modifiers []node.Node Properties []node.Node } @@ -34,11 +34,11 @@ func (n *PropertyList) SetPosition(p *node.Position) node.Node { return n } -func (n *PropertyList) Comments() *[]comment.Comment { +func (n *PropertyList) Comments() []comment.Comment { return n.comments } -func (n *PropertyList) SetComments(c *[]comment.Comment) node.Node { +func (n *PropertyList) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/return.go b/node/stmt/return.go index 321ffd2..2d004de 100644 --- a/node/stmt/return.go +++ b/node/stmt/return.go @@ -7,7 +7,7 @@ import ( type Return struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Expr node.Node } @@ -32,11 +32,11 @@ func (n *Return) SetPosition(p *node.Position) node.Node { return n } -func (n *Return) Comments() *[]comment.Comment { +func (n *Return) Comments() []comment.Comment { return n.comments } -func (n *Return) SetComments(c *[]comment.Comment) node.Node { +func (n *Return) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/static.go b/node/stmt/static.go index b517739..426b162 100644 --- a/node/stmt/static.go +++ b/node/stmt/static.go @@ -7,7 +7,7 @@ import ( type Static struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Vars []node.Node } @@ -32,11 +32,11 @@ func (n *Static) SetPosition(p *node.Position) node.Node { return n } -func (n *Static) Comments() *[]comment.Comment { +func (n *Static) Comments() []comment.Comment { return n.comments } -func (n *Static) SetComments(c *[]comment.Comment) node.Node { +func (n *Static) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/static_var.go b/node/stmt/static_var.go index 5e98915..40ed2c2 100644 --- a/node/stmt/static_var.go +++ b/node/stmt/static_var.go @@ -7,7 +7,7 @@ import ( type StaticVar struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Variable node.Node Expr node.Node } @@ -34,11 +34,11 @@ func (n *StaticVar) SetPosition(p *node.Position) node.Node { return n } -func (n *StaticVar) Comments() *[]comment.Comment { +func (n *StaticVar) Comments() []comment.Comment { return n.comments } -func (n *StaticVar) SetComments(c *[]comment.Comment) node.Node { +func (n *StaticVar) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/stmt_list.go b/node/stmt/stmt_list.go index 9f6fa58..20fcd2c 100644 --- a/node/stmt/stmt_list.go +++ b/node/stmt/stmt_list.go @@ -7,7 +7,7 @@ import ( type StmtList struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Stmts []node.Node } @@ -32,11 +32,11 @@ func (n *StmtList) SetPosition(p *node.Position) node.Node { return n } -func (n *StmtList) Comments() *[]comment.Comment { +func (n *StmtList) Comments() []comment.Comment { return n.comments } -func (n *StmtList) SetComments(c *[]comment.Comment) node.Node { +func (n *StmtList) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/switch.go b/node/stmt/switch.go index 145127a..4a062a0 100644 --- a/node/stmt/switch.go +++ b/node/stmt/switch.go @@ -8,7 +8,7 @@ import ( type Switch struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment token token.Token Cond node.Node cases []node.Node @@ -37,11 +37,11 @@ func (n *Switch) SetPosition(p *node.Position) node.Node { return n } -func (n *Switch) Comments() *[]comment.Comment { +func (n *Switch) Comments() []comment.Comment { return n.comments } -func (n *Switch) SetComments(c *[]comment.Comment) node.Node { +func (n *Switch) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/throw.go b/node/stmt/throw.go index 1734863..115b0ff 100644 --- a/node/stmt/throw.go +++ b/node/stmt/throw.go @@ -7,7 +7,7 @@ import ( type Throw struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Expr node.Node } @@ -32,11 +32,11 @@ func (n *Throw) SetPosition(p *node.Position) node.Node { return n } -func (n *Throw) Comments() *[]comment.Comment { +func (n *Throw) Comments() []comment.Comment { return n.comments } -func (n *Throw) SetComments(c *[]comment.Comment) node.Node { +func (n *Throw) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/trait.go b/node/stmt/trait.go index 01820c9..6ac83a8 100644 --- a/node/stmt/trait.go +++ b/node/stmt/trait.go @@ -7,7 +7,7 @@ import ( type Trait struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment PhpDocComment string TraitName node.Node Stmts []node.Node @@ -38,11 +38,11 @@ func (n *Trait) SetPosition(p *node.Position) node.Node { return n } -func (n *Trait) Comments() *[]comment.Comment { +func (n *Trait) Comments() []comment.Comment { return n.comments } -func (n *Trait) SetComments(c *[]comment.Comment) node.Node { +func (n *Trait) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/trait_method_ref.go b/node/stmt/trait_method_ref.go index ab9d137..cff0d1b 100644 --- a/node/stmt/trait_method_ref.go +++ b/node/stmt/trait_method_ref.go @@ -7,7 +7,7 @@ import ( type TraitMethodRef struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Trait node.Node Method node.Node } @@ -34,11 +34,11 @@ func (n *TraitMethodRef) SetPosition(p *node.Position) node.Node { return n } -func (n *TraitMethodRef) Comments() *[]comment.Comment { +func (n *TraitMethodRef) Comments() []comment.Comment { return n.comments } -func (n *TraitMethodRef) SetComments(c *[]comment.Comment) node.Node { +func (n *TraitMethodRef) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/trait_use.go b/node/stmt/trait_use.go index c0aaf06..70bfed1 100644 --- a/node/stmt/trait_use.go +++ b/node/stmt/trait_use.go @@ -7,7 +7,7 @@ import ( type TraitUse struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Traits []node.Node Adaptations []node.Node } @@ -34,11 +34,11 @@ func (n *TraitUse) SetPosition(p *node.Position) node.Node { return n } -func (n *TraitUse) Comments() *[]comment.Comment { +func (n *TraitUse) Comments() []comment.Comment { return n.comments } -func (n *TraitUse) SetComments(c *[]comment.Comment) node.Node { +func (n *TraitUse) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/trait_use_alias.go b/node/stmt/trait_use_alias.go index 9629c17..bab8bd3 100644 --- a/node/stmt/trait_use_alias.go +++ b/node/stmt/trait_use_alias.go @@ -7,7 +7,7 @@ import ( type TraitUseAlias struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Ref node.Node Modifier node.Node Alias node.Node @@ -36,11 +36,11 @@ func (n *TraitUseAlias) SetPosition(p *node.Position) node.Node { return n } -func (n *TraitUseAlias) Comments() *[]comment.Comment { +func (n *TraitUseAlias) Comments() []comment.Comment { return n.comments } -func (n *TraitUseAlias) SetComments(c *[]comment.Comment) node.Node { +func (n *TraitUseAlias) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/trait_use_precedence.go b/node/stmt/trait_use_precedence.go index 2027bd2..31d2f62 100644 --- a/node/stmt/trait_use_precedence.go +++ b/node/stmt/trait_use_precedence.go @@ -7,7 +7,7 @@ import ( type TraitUsePrecedence struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Ref node.Node Insteadof node.Node } @@ -34,11 +34,11 @@ func (n *TraitUsePrecedence) SetPosition(p *node.Position) node.Node { return n } -func (n *TraitUsePrecedence) Comments() *[]comment.Comment { +func (n *TraitUsePrecedence) Comments() []comment.Comment { return n.comments } -func (n *TraitUsePrecedence) SetComments(c *[]comment.Comment) node.Node { +func (n *TraitUsePrecedence) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/try.go b/node/stmt/try.go index b6f9bb3..5d1de57 100644 --- a/node/stmt/try.go +++ b/node/stmt/try.go @@ -7,7 +7,7 @@ import ( type Try struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Stmts []node.Node Catches []node.Node Finally node.Node @@ -36,11 +36,11 @@ func (n *Try) SetPosition(p *node.Position) node.Node { return n } -func (n *Try) Comments() *[]comment.Comment { +func (n *Try) Comments() []comment.Comment { return n.comments } -func (n *Try) SetComments(c *[]comment.Comment) node.Node { +func (n *Try) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/unset.go b/node/stmt/unset.go index 197278c..a654235 100644 --- a/node/stmt/unset.go +++ b/node/stmt/unset.go @@ -7,7 +7,7 @@ import ( type Unset struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Vars []node.Node } @@ -32,11 +32,11 @@ func (n *Unset) SetPosition(p *node.Position) node.Node { return n } -func (n *Unset) Comments() *[]comment.Comment { +func (n *Unset) Comments() []comment.Comment { return n.comments } -func (n *Unset) SetComments(c *[]comment.Comment) node.Node { +func (n *Unset) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/use.go b/node/stmt/use.go index 6a80a95..ccc00f3 100644 --- a/node/stmt/use.go +++ b/node/stmt/use.go @@ -7,7 +7,7 @@ import ( type Use struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment UseType node.Node Use node.Node Alias node.Node @@ -36,11 +36,11 @@ func (n *Use) SetPosition(p *node.Position) node.Node { return n } -func (n *Use) Comments() *[]comment.Comment { +func (n *Use) Comments() []comment.Comment { return n.comments } -func (n *Use) SetComments(c *[]comment.Comment) node.Node { +func (n *Use) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/use_list.go b/node/stmt/use_list.go index 51785d4..078bc47 100644 --- a/node/stmt/use_list.go +++ b/node/stmt/use_list.go @@ -7,7 +7,7 @@ import ( type UseList struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment UseType node.Node Uses []node.Node } @@ -34,11 +34,11 @@ func (n *UseList) SetPosition(p *node.Position) node.Node { return n } -func (n *UseList) Comments() *[]comment.Comment { +func (n *UseList) Comments() []comment.Comment { return n.comments } -func (n *UseList) SetComments(c *[]comment.Comment) node.Node { +func (n *UseList) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/node/stmt/while.go b/node/stmt/while.go index a7865b4..f28cefc 100644 --- a/node/stmt/while.go +++ b/node/stmt/while.go @@ -8,7 +8,7 @@ import ( type While struct { position *node.Position - comments *[]comment.Comment + comments []comment.Comment Token token.Token Cond node.Node Stmt node.Node @@ -37,11 +37,11 @@ func (n *While) SetPosition(p *node.Position) node.Node { return n } -func (n *While) Comments() *[]comment.Comment { +func (n *While) Comments() []comment.Comment { return n.comments } -func (n *While) SetComments(c *[]comment.Comment) node.Node { +func (n *While) SetComments(c []comment.Comment) node.Node { n.comments = c return n } diff --git a/parser/lexer.go b/parser/lexer.go index b76056f..8d01074 100644 --- a/parser/lexer.go +++ b/parser/lexer.go @@ -22,7 +22,7 @@ type lexer struct { *lex.Lexer stateStack []int phpDocComment string - comments *[]comment.Comment + comments []comment.Comment } func rune2Class(r rune) int { @@ -101,9 +101,5 @@ func (l *lexer) newToken(tokenBytes []byte) t.Token { } func (l *lexer) addComment(c comment.Comment) { - if l.comments == nil { - l.comments = &[]comment.Comment{c} - } else { - *l.comments = append(*l.comments, c) - } + l.comments = append(l.comments, c) } diff --git a/parser/parser.go b/parser/parser.go index 8958609..eff9f88 100644 --- a/parser/parser.go +++ b/parser/parser.go @@ -30,7 +30,7 @@ func Parse(src io.Reader, fName string) node.Node { return rootnode } -func ListGetFirstNodeComments(list []node.Node) *[]comment.Comment { +func ListGetFirstNodeComments(list []node.Node) []comment.Comment { if len(list) == 0 { return nil } diff --git a/parser/parser.y b/parser/parser.y index 325dfe1..a9252b2 100644 --- a/parser/parser.y +++ b/parser/parser.y @@ -27,7 +27,7 @@ func Parse(src io.Reader, fName string) node.Node { return rootnode } -func ListGetFirstNodeComments(list []node.Node) *[]comment.Comment { +func ListGetFirstNodeComments(list []node.Node) []comment.Comment { if len(list) == 0 { return nil } diff --git a/token/token.go b/token/token.go index 55cf52c..3f6ef9a 100644 --- a/token/token.go +++ b/token/token.go @@ -8,8 +8,8 @@ type TokenInterface interface { GetValue() string GetStartLine() int GetEndLine() int - Comments() *[]comment.Comment - SetComments(comments *[]comment.Comment) Token + Comments() []comment.Comment + SetComments(comments []comment.Comment) Token } type Token struct { @@ -18,7 +18,7 @@ type Token struct { EndLine int StartPos int EndPos int - comments *[]comment.Comment + comments []comment.Comment } func NewToken(value []byte, startLine int, endLine int, startPos int, endPos int) Token { @@ -39,11 +39,11 @@ func (t Token) GetEndLine() int { return t.EndLine } -func (t Token) Comments() *[]comment.Comment { +func (t Token) Comments() []comment.Comment { return t.comments } -func (t Token) SetComments(comments *[]comment.Comment) Token { +func (t Token) SetComments(comments []comment.Comment) Token { t.comments = comments return t }