Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comment ¶
type Comment struct { Slash source.Pos // position of "/" starting the comment Text string // comment text (excluding '\n' for //-style comments) }
A Comment node represents a single //-style or /*-style comment.
type CommentGroup ¶
type CommentGroup struct {
List []*Comment // len(List) > 0
}
A CommentGroup represents a sequence of comments with no other tokens and no empty lines between.
func (*CommentGroup) End ¶
func (g *CommentGroup) End() source.Pos
End returns the position of last comment's end position.
func (*CommentGroup) Pos ¶
func (g *CommentGroup) Pos() source.Pos
Pos returns the position of the first comment.
func (*CommentGroup) Text ¶
func (g *CommentGroup) Text() string
Text returns the text of the comment. Comment markers (//, /*, and */), the first space of a line comment, and leading and trailing empty lines are removed. Multiple empty lines are reduced to one, and trailing space on lines is trimmed. Unless the result is empty, it is newline-terminated.
type Node ¶
type Node interface { // Pos returns the position of first character belonging to the node. Pos() source.Pos // End returns the position of first character immediately after the node. End() source.Pos // String returns a string representation of the node. String() string }
Node represents a node in the AST.
Click to show internal directories.
Click to hide internal directories.