Documentation ¶
Overview ¶
Package parsebody parses the contract sections from the function body.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Contract ¶
type Contract struct { // Start indicates the first node of the contract. // If Start == token.NoPos, there is no contract in the function body. Start token.Pos End token.Pos // NextNodePos indicates the position of the first AST node just after the contract. // If there are no nodes in the function body after the contract, NextNodePos is token.NoPos. NextNodePos token.Pos }
Contract indicates the token section corresponding to the contract blocks.
func ToContract ¶
func ToContract( fset *token.FileSet, fn *ast.FuncDecl, bodyCmtMap ast.CommentMap) (c Contract, err error)
ToContract searches for the start and end of the contract in the function body.
Click to show internal directories.
Click to hide internal directories.