compiler

package
v0.0.0-...-c2f03b5 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2014 License: BSD-2-Clause Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Import

func Import(path string, mode build.ImportMode, archSuffix string) (*build.Package, error)

func Parse

func Parse(pkg *build.Package, fileSet *token.FileSet) ([]*ast.File, error)

Types

type Archive

type Archive struct {
	ImportPath   PkgPath
	GcData       []byte
	Dependencies []PkgPath
	Imports      []PkgImport
	Declarations []Decl
	Tests        []string
	FileSet      []byte
}

func (*Archive) AddDependenciesOf

func (a *Archive) AddDependenciesOf(other *Archive)

func (*Archive) AddDependency

func (a *Archive) AddDependency(path string)

type Compiler

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

func New

func New() *Compiler

func (*Compiler) Compile

func (t *Compiler) Compile(importPath string, files []*ast.File, fileSet *token.FileSet, importPkg func(string) (*Archive, error), minify bool) (*Archive, error)

func (*Compiler) MarshalArchive

func (t *Compiler) MarshalArchive(a *Archive) ([]byte, error)

func (*Compiler) NewEmptyTypesPackage

func (t *Compiler) NewEmptyTypesPackage(path string)

func (*Compiler) UnmarshalArchive

func (t *Compiler) UnmarshalArchive(filename, id string, data []byte) (*Archive, error)

func (*Compiler) WritePkgCode

func (t *Compiler) WritePkgCode(pkg *Archive, minify bool, w *SourceMapFilter)

func (*Compiler) WriteProgramCode

func (t *Compiler) WriteProgramCode(pkgs []*Archive, mainPkgPath string, minify bool, w *SourceMapFilter)

type Decl

type Decl struct {
	Var        string
	BodyCode   []byte
	InitCode   []byte
	DceFilters []DepId
	DceDeps    []DepId
}

type DepId

type DepId []byte // make asn1 happy

type ErrorList

type ErrorList []error

func (ErrorList) Error

func (err ErrorList) Error() string

type ImportCError

type ImportCError struct{}

func (*ImportCError) Error

func (e *ImportCError) Error() string

type PkgImport

type PkgImport struct {
	Path    PkgPath
	VarName string
}

type PkgPath

type PkgPath []byte // make asn1 happy

type SourceMapFilter

type SourceMapFilter struct {
	Writer          io.Writer
	MappingCallback func(generatedLine, generatedColumn int, fileSet *token.FileSet, originalPos token.Pos)
	// contains filtered or unexported fields
}

func (*SourceMapFilter) Write

func (f *SourceMapFilter) Write(p []byte) (n int, err error)

type This

type This struct {
	ast.Ident
}

Jump to

Keyboard shortcuts

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