ast

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadDirOptions

func LoadDirOptions() *loadDirOptions

Types

type File

type File interface {
	// relative to loading root
	RelPath() string
	Ast() *ast.File
	Content() []byte

	// has syntax error
	SyntaxError() error
}

type LoadInfo

type LoadInfo interface {
	FileSet() *token.FileSet
	RangeFiles(handler func(f File) bool)
}

LoadInfo is the core abstraction of an AST load

func LoadCode

func LoadCode(relPath string, code []byte) (LoadInfo, error)

func LoadDir

func LoadDir(dir string) (LoadInfo, error)

LoadDir scans a given directory to specify extra options, one can use:

LoadDirOptions().Exclude("vendor").Load("some/go_project")

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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