Documentation ¶
Overview ¶
https://medium.com/justforfunc/understanding-go-programs-with-go-parser-c4e88a6edb87
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileInfo ¶
type FileInfo struct { PackageName string FileBuffer []byte RootNode *Node FileConstants []ConstValue }
FileInfo is the output of ReadFile().
type Node ¶
type Node struct { Bytes string Name string BytesIndexBegin int BytesIndexEnd int TypeStr string DepthLevel int Father *Node Children []*Node Index int // index of this node among the children of Father // contains filtered or unexported fields }
func (*Node) ComputeStringExpression ¶
func (n *Node) ComputeStringExpression(fileConstants []ConstValue) (str string, incomplete bool)
ComputeStringExpression compute/concatenate (recursively) a constant string expression, e.g. "foo"+"bar"+string("baz") will return ("foobarbaz", false).
This is a work in process, trying to compute all constants string expressions that we can know at compile-time.
If it contains something which is not processable, it will return incomplete=true and all unprocessable parts will be replaced by "???" in str.
func (*Node) IsCommentGroupWithComment ¶
IsCommentGroupWithComment returns true if this is a CommentGroup with the comment in it.
Click to show internal directories.
Click to hide internal directories.