ast

package
v0.0.0-...-fab57c2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package ast provides a mockable wrapper for go/ast.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Impl

type Impl struct{}

func (*Impl) FileExports

func (*Impl) FileExports(src *ast.File) bool

func (*Impl) FilterDecl

func (*Impl) FilterDecl(decl ast.Decl, f ast.Filter) bool

func (*Impl) FilterFile

func (*Impl) FilterFile(src *ast.File, f ast.Filter) bool

func (*Impl) FilterPackage

func (*Impl) FilterPackage(pkg *ast.Package, f ast.Filter) bool

func (*Impl) Fprint

func (*Impl) Fprint(w io.Writer, fset *token.FileSet, x any, f ast.FieldFilter) error

func (*Impl) Inspect

func (*Impl) Inspect(node ast.Node, f func(ast.Node) bool)

func (*Impl) IsExported

func (*Impl) IsExported(name string) bool

func (*Impl) MergePackageFiles

func (*Impl) MergePackageFiles(pkg *ast.Package, mode ast.MergeMode) *ast.File

func (*Impl) NewCommentMap

func (*Impl) NewCommentMap(fset *token.FileSet, node ast.Node, comments []*ast.CommentGroup) ast.CommentMap

func (*Impl) NewIdent

func (*Impl) NewIdent(name string) *ast.Ident

func (*Impl) NewObj

func (*Impl) NewObj(kind ast.ObjKind, name string) *ast.Object

func (*Impl) NewPackage

func (*Impl) NewPackage(fset *token.FileSet, files map[string]*ast.File, importer ast.Importer, universe *ast.Scope) (*ast.Package, error)

func (*Impl) NewScope

func (*Impl) NewScope(outer *ast.Scope) *ast.Scope

func (*Impl) NotNilFilter

func (*Impl) NotNilFilter(__v string, v_v reflect.Value) bool

func (*Impl) PackageExports

func (*Impl) PackageExports(pkg *ast.Package) bool

func (*Impl) Print

func (*Impl) Print(fset *token.FileSet, x any) error

func (*Impl) SortImports

func (*Impl) SortImports(fset *token.FileSet, f *ast.File)

func (*Impl) Walk

func (*Impl) Walk(v ast.Visitor, node ast.Node)

type Interface

type Interface interface {
	FileExports(src *ast.File) bool
	FilterDecl(decl ast.Decl, f ast.Filter) bool
	FilterFile(src *ast.File, f ast.Filter) bool
	FilterPackage(pkg *ast.Package, f ast.Filter) bool
	Fprint(w io.Writer, fset *token.FileSet, x any, f ast.FieldFilter) error
	Inspect(node ast.Node, f func(ast.Node) bool)
	IsExported(name string) bool
	MergePackageFiles(pkg *ast.Package, mode ast.MergeMode) *ast.File
	NewCommentMap(fset *token.FileSet, node ast.Node, comments []*ast.CommentGroup) ast.CommentMap
	NewIdent(name string) *ast.Ident
	NewObj(kind ast.ObjKind, name string) *ast.Object
	NewPackage(fset *token.FileSet, files map[string]*ast.File, importer ast.Importer, universe *ast.Scope) (*ast.Package, error)
	NewScope(outer *ast.Scope) *ast.Scope
	NotNilFilter(_ string, v reflect.Value) bool
	PackageExports(pkg *ast.Package) bool
	Print(fset *token.FileSet, x any) error
	SortImports(fset *token.FileSet, f *ast.File)
	Walk(v ast.Visitor, node ast.Node)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳