fix comments pointers
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user