gogrep

package
v0.3.11-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEmptyNodeSlice

func IsEmptyNodeSlice(n ast.Node) bool

Types

type CapturedNode

type CapturedNode struct {
	Name string
	Node ast.Node
}

type ExprSlice added in v0.3.6

type ExprSlice []ast.Expr

func (ExprSlice) At added in v0.3.6

func (l ExprSlice) At(i int) ast.Node

func (ExprSlice) End added in v0.3.6

func (l ExprSlice) End() token.Pos

func (ExprSlice) Len added in v0.3.6

func (l ExprSlice) Len() int

func (ExprSlice) Pos added in v0.3.6

func (l ExprSlice) Pos() token.Pos

type MatchData

type MatchData struct {
	Node    ast.Node
	Capture []CapturedNode
}

MatchData describes a successful pattern match.

func (MatchData) CapturedByName

func (data MatchData) CapturedByName(name string) (ast.Node, bool)

type NodeSlice added in v0.3.6

type NodeSlice interface {
	At(i int) ast.Node
	Len() int

	ast.Node
	// contains filtered or unexported methods
}

type Pattern

type Pattern struct {
	// contains filtered or unexported fields
}

func Compile

func Compile(fset *token.FileSet, src string, strict bool) (*Pattern, error)

func (*Pattern) Clone

func (p *Pattern) Clone() *Pattern

Clone creates a pattern copy.

func (*Pattern) MatchNode

func (p *Pattern) MatchNode(info *types.Info, n ast.Node, cb func(MatchData))

MatchNode calls cb if n matches a pattern.

func (*Pattern) NodeTag

func (p *Pattern) NodeTag() nodetag.Value

Jump to

Keyboard shortcuts

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