astrid

package module
v0.0.0-...-8c28958 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2017 License: MIT Imports: 3 Imported by: 19

README

Build Status Go Report Card codecov

Astrid

Astrid is a collection of AST utilities for Go

Matcher

NewMatcher returns a new *Matcher with the provided Uses and Defs from types.Info

Matcher.Match

Match determines whether two ast.Expr's are equivalent

Invert

Invert returns the inverse of the provided expression.

Documentation

Overview

Package astrid is a collection of AST utilities

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Invert

func Invert(node ast.Expr) ast.Expr

Invert returns the inverse of the provided expression.

func StripPosition

func StripPosition(node ast.Node)

StripPosition removes all position information from a node and all descendants. This is useful before printing a modified node.

Types

type Matcher

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

Matcher matches ast expressions

func NewMatcher

func NewMatcher(uses, defs map[*ast.Ident]types.Object) *Matcher

NewMatcher returns a new *Matcher with the provided Uses and Defs from types.Info

func (*Matcher) Match

func (m *Matcher) Match(a, b ast.Expr) bool

Match determines whether two ast.Expr's are equivalent

func (*Matcher) MatchSlice

func (m *Matcher) MatchSlice(a, b []ast.Expr) bool

MatchSlice determines whether two slices of ast.Expr's are equivalent

Jump to

Keyboard shortcuts

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