php-parser/comment/comment.go

17 lines
415 B
Go
Raw Normal View History

2018-01-02 22:12:28 +00:00
package comment
2018-01-08 22:30:28 +00:00
import "github.com/z7zmey/php-parser/node"
2018-01-12 06:23:58 +00:00
// Comment represents comment lines in the code
2018-01-02 22:12:28 +00:00
type Comment interface {
String() string
}
2018-01-08 22:30:28 +00:00
2018-01-12 06:23:58 +00:00
// Comments a collection of comment groups assigned to nodes
2018-01-08 22:30:28 +00:00
type Comments map[node.Node][]Comment
2018-01-12 06:23:58 +00:00
// AddComments add comment group to the collection
2018-01-08 22:30:28 +00:00
func (c Comments) AddComments(node node.Node, comments []Comment) {
c[node] = append(c[node], comments...)
}