compiler

package
v0.0.0-...-eb6c5df Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const GOROUTINES = false

Variables

This section is empty.

Functions

func MarshalArchive

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

func WritePkgCode

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

func WriteProgramCode

func WriteProgramCode(pkgs []*Archive, importContext *ImportContext, w *SourceMapFilter)

Types

type Archive

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

func Compile

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

func UnmarshalArchive

func UnmarshalArchive(filename, id string, data []byte, importContext *ImportContext) (*Archive, error)

func (*Archive) AddDependenciesOf

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

func (*Archive) AddDependency

func (a *Archive) AddDependency(path string)

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 ImportContext

type ImportContext struct {
	Packages map[string]*types.Package
	Import   func(string) (*Archive, error)
}

func NewImportContext

func NewImportContext(importFunc func(string) (*Archive, error)) *ImportContext

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