parsebody

package
Version: v1.3.0 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: 1

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.

Source Files

Jump to

Keyboard shortcuts

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