#25: save comments within node

This commit is contained in:
z7zmey
2018-06-25 15:38:31 +03:00
parent 1ebb0c6fad
commit 3cd45ecac5
183 changed files with 16743 additions and 14671 deletions

View File

@@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@@ -8,6 +9,7 @@ import (
// BitwiseAnd node
type BitwiseAnd struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@@ -31,6 +33,17 @@ func (n *BitwiseAnd) GetPosition() *position.Position {
return n.Position
}
func (n *BitwiseAnd) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *BitwiseAnd) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *BitwiseAnd) Attributes() map[string]interface{} {
return nil

View File

@@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@@ -8,6 +9,7 @@ import (
// BitwiseOr node
type BitwiseOr struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@@ -31,6 +33,17 @@ func (n *BitwiseOr) GetPosition() *position.Position {
return n.Position
}
func (n *BitwiseOr) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *BitwiseOr) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *BitwiseOr) Attributes() map[string]interface{} {
return nil

View File

@@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@@ -8,6 +9,7 @@ import (
// BitwiseXor node
type BitwiseXor struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@@ -31,6 +33,17 @@ func (n *BitwiseXor) GetPosition() *position.Position {
return n.Position
}
func (n *BitwiseXor) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *BitwiseXor) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *BitwiseXor) Attributes() map[string]interface{} {
return nil

View File

@@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@@ -8,6 +9,7 @@ import (
// BooleanAnd node
type BooleanAnd struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@@ -31,6 +33,17 @@ func (n *BooleanAnd) GetPosition() *position.Position {
return n.Position
}
func (n *BooleanAnd) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *BooleanAnd) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *BooleanAnd) Attributes() map[string]interface{} {
return nil

View File

@@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@@ -8,6 +9,7 @@ import (
// BooleanOr node
type BooleanOr struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@@ -31,6 +33,17 @@ func (n *BooleanOr) GetPosition() *position.Position {
return n.Position
}
func (n *BooleanOr) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *BooleanOr) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *BooleanOr) Attributes() map[string]interface{} {
return nil

View File

@@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@@ -8,6 +9,7 @@ import (
// Coalesce node
type Coalesce struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@@ -31,6 +33,17 @@ func (n *Coalesce) GetPosition() *position.Position {
return n.Position
}
func (n *Coalesce) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Coalesce) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Coalesce) Attributes() map[string]interface{} {
return nil

View File

@@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@@ -8,6 +9,7 @@ import (
// Concat node
type Concat struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@@ -31,6 +33,17 @@ func (n *Concat) GetPosition() *position.Position {
return n.Position
}
func (n *Concat) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Concat) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Concat) Attributes() map[string]interface{} {
return nil

View File

@@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@@ -8,6 +9,7 @@ import (
// Div node
type Div struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@@ -31,6 +33,17 @@ func (n *Div) GetPosition() *position.Position {
return n.Position
}
func (n *Div) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Div) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Div) Attributes() map[string]interface{} {
return nil

View File

@@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@@ -8,6 +9,7 @@ import (
// Equal node
type Equal struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@@ -31,6 +33,17 @@ func (n *Equal) GetPosition() *position.Position {
return n.Position
}
func (n *Equal) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Equal) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Equal) Attributes() map[string]interface{} {
return nil

View File

@@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@@ -8,6 +9,7 @@ import (
// Greater node
type Greater struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@@ -31,6 +33,17 @@ func (n *Greater) GetPosition() *position.Position {
return n.Position
}
func (n *Greater) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Greater) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Greater) Attributes() map[string]interface{} {
return nil

View File

@@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@@ -8,6 +9,7 @@ import (
// GreaterOrEqual node
type GreaterOrEqual struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@@ -31,6 +33,17 @@ func (n *GreaterOrEqual) GetPosition() *position.Position {
return n.Position
}
func (n *GreaterOrEqual) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *GreaterOrEqual) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *GreaterOrEqual) Attributes() map[string]interface{} {
return nil

View File

@@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@@ -8,6 +9,7 @@ import (
// Identical node
type Identical struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@@ -31,6 +33,17 @@ func (n *Identical) GetPosition() *position.Position {
return n.Position
}
func (n *Identical) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Identical) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Identical) Attributes() map[string]interface{} {
return nil

View File

@@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@@ -8,6 +9,7 @@ import (
// LogicalAnd node
type LogicalAnd struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@@ -31,6 +33,17 @@ func (n *LogicalAnd) GetPosition() *position.Position {
return n.Position
}
func (n *LogicalAnd) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *LogicalAnd) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *LogicalAnd) Attributes() map[string]interface{} {
return nil

View File

@@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@@ -8,6 +9,7 @@ import (
// LogicalOr node
type LogicalOr struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@@ -31,6 +33,17 @@ func (n *LogicalOr) GetPosition() *position.Position {
return n.Position
}
func (n *LogicalOr) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *LogicalOr) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *LogicalOr) Attributes() map[string]interface{} {
return nil

View File

@@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@@ -8,6 +9,7 @@ import (
// LogicalXor node
type LogicalXor struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@@ -31,6 +33,17 @@ func (n *LogicalXor) GetPosition() *position.Position {
return n.Position
}
func (n *LogicalXor) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *LogicalXor) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *LogicalXor) Attributes() map[string]interface{} {
return nil

View File

@@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@@ -8,6 +9,7 @@ import (
// Minus node
type Minus struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@@ -31,6 +33,17 @@ func (n *Minus) GetPosition() *position.Position {
return n.Position
}
func (n *Minus) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Minus) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Minus) Attributes() map[string]interface{} {
return nil

View File

@@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@@ -8,6 +9,7 @@ import (
// Mod node
type Mod struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@@ -31,6 +33,17 @@ func (n *Mod) GetPosition() *position.Position {
return n.Position
}
func (n *Mod) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Mod) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Mod) Attributes() map[string]interface{} {
return nil

View File

@@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@@ -8,6 +9,7 @@ import (
// Mul node
type Mul struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@@ -31,6 +33,17 @@ func (n *Mul) GetPosition() *position.Position {
return n.Position
}
func (n *Mul) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Mul) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Mul) Attributes() map[string]interface{} {
return nil

View File

@@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@@ -8,6 +9,7 @@ import (
// NotEqual node
type NotEqual struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@@ -31,6 +33,17 @@ func (n *NotEqual) GetPosition() *position.Position {
return n.Position
}
func (n *NotEqual) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *NotEqual) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *NotEqual) Attributes() map[string]interface{} {
return nil

View File

@@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@@ -8,6 +9,7 @@ import (
// NotIdentical node
type NotIdentical struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@@ -31,6 +33,17 @@ func (n *NotIdentical) GetPosition() *position.Position {
return n.Position
}
func (n *NotIdentical) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *NotIdentical) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *NotIdentical) Attributes() map[string]interface{} {
return nil

View File

@@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@@ -8,6 +9,7 @@ import (
// Plus node
type Plus struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@@ -31,6 +33,17 @@ func (n *Plus) GetPosition() *position.Position {
return n.Position
}
func (n *Plus) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Plus) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Plus) Attributes() map[string]interface{} {
return nil

View File

@@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@@ -8,6 +9,7 @@ import (
// Pow node
type Pow struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@@ -31,6 +33,17 @@ func (n *Pow) GetPosition() *position.Position {
return n.Position
}
func (n *Pow) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Pow) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Pow) Attributes() map[string]interface{} {
return nil

View File

@@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@@ -8,6 +9,7 @@ import (
// ShiftLeft node
type ShiftLeft struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@@ -31,6 +33,17 @@ func (n *ShiftLeft) GetPosition() *position.Position {
return n.Position
}
func (n *ShiftLeft) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *ShiftLeft) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *ShiftLeft) Attributes() map[string]interface{} {
return nil

View File

@@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@@ -8,6 +9,7 @@ import (
// ShiftRight node
type ShiftRight struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@@ -31,6 +33,17 @@ func (n *ShiftRight) GetPosition() *position.Position {
return n.Position
}
func (n *ShiftRight) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *ShiftRight) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *ShiftRight) Attributes() map[string]interface{} {
return nil

View File

@@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@@ -8,6 +9,7 @@ import (
// Smaller node
type Smaller struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@@ -31,6 +33,17 @@ func (n *Smaller) GetPosition() *position.Position {
return n.Position
}
func (n *Smaller) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Smaller) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Smaller) Attributes() map[string]interface{} {
return nil

View File

@@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@@ -8,6 +9,7 @@ import (
// SmallerOrEqual node
type SmallerOrEqual struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@@ -31,6 +33,17 @@ func (n *SmallerOrEqual) GetPosition() *position.Position {
return n.Position
}
func (n *SmallerOrEqual) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *SmallerOrEqual) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *SmallerOrEqual) Attributes() map[string]interface{} {
return nil

View File

@@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@@ -8,6 +9,7 @@ import (
// Spaceship node
type Spaceship struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@@ -31,6 +33,17 @@ func (n *Spaceship) GetPosition() *position.Position {
return n.Position
}
func (n *Spaceship) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Spaceship) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Spaceship) Attributes() map[string]interface{} {
return nil