build

package
v0.0.0-...-90e8e0c Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidDir  = errors.New("invalid input dir")
	ErrNoInputFile = errors.New("no input file")
)
View Source
var (
	ErrDuplicateDescription = errors.New("duplicate description")
	ErrDuplicateImport      = errors.New("duplicate import")
	ErrDuplicateName        = errors.New("duplicate name")
	ErrEmptyName            = errors.New("name must be non empty")
	ErrImportCycle          = errors.New("import cycle")
	ErrInvalidToken         = errors.New("invalid token")
	ErrMissingIdentifier    = errors.New("missing identifier")
	ErrMissingPackage       = errors.New("missing package name")
	ErrMissingString        = errors.New("missing string")
)

Functions

func Build

func Build(fsys fs.FS, options *Options) error

Build the package at the root of `fsys`.

func GetFilePlatform

func GetFilePlatform(file string) platform.Platform

GetFilePlatform returns the platform for the given file.

func GetFiles

func GetFiles(fsys fs.FS, pt platform.Platform, suffix ast.FileExtension) ([]string, error)

Get the set of files from `fsys` top directory matching the platform and extension.

func Parse

func Parse(fsys fs.FS, files []string) ([]ast.StmtGlobal, []ast.Stmt, error)

Parse the `files` and return the set of globals and statements.

Types

type Imports

type Imports struct {
	Packages []*sema.Package
	// Names map a package name to its index in `Packages`.
	Names map[string]int
}

type Options

type Options struct {
	SemaOptions sema.Options
	Backend     backend.Backend
}

type PkgFile

type PkgFile struct {
	File                string
	Name                string
	NameLocation        ast.Location
	Description         string
	DescriptionLocation ast.Location

	Imports    []ast.StmtImport
	Statements []ast.Stmt
	// contains filtered or unexported fields
}

func GetPkgFile

func GetPkgFile(fsys fs.FS) (*PkgFile, error)

Get the package file if it exists (nil if not).

func (*PkgFile) Init

func (p *PkgFile) Init(file string, src io.Reader)

func (*PkgFile) Parse

func (p *PkgFile) Parse() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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