parse

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	// Name is the name of the file.
	Name string
	// AstFile is the parsed AST of the file, cannot be nil
	AstFile *ast.File
	// Aspects is the list of aspects that may match on this file.
	Aspects []*aspect.Aspect
}

File represents a parsed file with its name, its AST and with the aspects that may match on it.

type Parser

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

func NewParser

func NewParser(fset *token.FileSet, nbFiles int) *Parser

NewParser creates a new parser with the given token.FileSet and the number of files to parse.

func (*Parser) ParseFiles

func (p *Parser) ParseFiles(files []string, aspects []*aspect.Aspect) ([]File, error)

ParseFiles return either zero files if no aspect matched on any file of the package, or all files parsed with their respective aspects that can match on them.

Jump to

Keyboard shortcuts

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