parsebody

package
v0.0.0-...-1866c15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2019 License: MIT Imports: 5 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL