astutil

package
v0.2.30 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: MIT Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEnclose

func IsEnclose(node ast.Node, pos token.Pos) bool

Types

type NodeMatcher

type NodeMatcher struct {
	NodeTypes     []ast.NodeType
	ExpectTokens  []token.Kind
	ExpectSQLType []dialect.KeywordKind
	ExpectKeyword []string
}

func (*NodeMatcher) IsMatch

func (nm *NodeMatcher) IsMatch(node ast.Node) bool

func (*NodeMatcher) IsMatchKeyword

func (nm *NodeMatcher) IsMatchKeyword(node ast.Node) bool

func (*NodeMatcher) IsMatchNodeTypes

func (nm *NodeMatcher) IsMatchNodeTypes(node ast.Node) bool

func (*NodeMatcher) IsMatchSQLType

func (nm *NodeMatcher) IsMatchSQLType(tok *ast.SQLToken) bool

func (*NodeMatcher) IsMatchTokens

func (nm *NodeMatcher) IsMatchTokens(tok *ast.SQLToken) bool

type NodeReader

type NodeReader struct {
	Node    ast.TokenList
	CurNode ast.Node
	Index   int
}

func NewNodeReader

func NewNodeReader(list ast.TokenList) *NodeReader

func (*NodeReader) CopyReader

func (nr *NodeReader) CopyReader() *NodeReader

func (*NodeReader) CurNodeEncloseIs

func (nr *NodeReader) CurNodeEncloseIs(pos token.Pos) bool

func (*NodeReader) CurNodeIs

func (nr *NodeReader) CurNodeIs(nm NodeMatcher) bool

func (*NodeReader) FindNode

func (nr *NodeReader) FindNode(ignoreWhiteSpace bool, nm NodeMatcher) (*NodeReader, ast.Node)

func (*NodeReader) FindRecursive

func (nr *NodeReader) FindRecursive(matcher NodeMatcher) []ast.Node

func (*NodeReader) NextNode

func (nr *NodeReader) NextNode(ignoreWhiteSpace bool) bool

func (*NodeReader) NodesWithRange

func (nr *NodeReader) NodesWithRange(startIndex, endIndex int) []ast.Node

func (*NodeReader) PeekNode

func (nr *NodeReader) PeekNode(ignoreWhiteSpace bool) (int, ast.Node)

func (*NodeReader) PeekNodeEncloseIs

func (nr *NodeReader) PeekNodeEncloseIs(pos token.Pos) bool

func (*NodeReader) PeekNodeIs

func (nr *NodeReader) PeekNodeIs(ignoreWhiteSpace bool, nm NodeMatcher) bool

func (*NodeReader) PrevNode

func (nr *NodeReader) PrevNode(ignoreWhiteSpace bool) (int, ast.Node)

func (*NodeReader) PrevNodeIs

func (nr *NodeReader) PrevNodeIs(ignoreWhiteSpace bool, nm NodeMatcher) bool

func (*NodeReader) Replace

func (nr *NodeReader) Replace(add ast.Node, index int)

func (*NodeReader) TailNode

func (nr *NodeReader) TailNode() (int, ast.Node)

Jump to

Keyboard shortcuts

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