compiler

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2021 License: BSD-2-Clause Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "1.16rc1"

Version is the GopherJS compiler version string.

Variables

This section is empty.

Functions

func WriteArchive

func WriteArchive(a *Archive, w io.Writer) error

func WritePkgCode

func WritePkgCode(pkg *Archive, dceSelection map[*Decl]struct{}, minify bool, w *SourceMapFilter) error

func WriteProgramCode

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

Types

type Archive

type Archive struct {
	ImportPath   string
	Name         string
	Imports      []string
	ExportData   []byte
	Declarations []*Decl
	IncJSCode    []byte
	FileSet      []byte
	Minified     bool
}

func Compile

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

func ImportDependencies

func ImportDependencies(archive *Archive, importPkg func(string) (*Archive, error)) ([]*Archive, error)

func ReadArchive

func ReadArchive(filename, path string, r io.Reader, packages map[string]*types.Package) (*Archive, error)

type Decl

type Decl struct {
	FullName        string
	Vars            []string
	DeclCode        []byte
	MethodListCode  []byte
	TypeInitCode    []byte
	InitCode        []byte
	DceObjectFilter string
	DceMethodFilter string
	DceDeps         []string
	Blocking        bool
}

type Dependency

type Dependency struct {
	Pkg    string
	Type   string
	Method string
}

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)
}

type LinkName added in v1.1.2

type LinkName struct {
	Local            string
	Target           string
	TargetName       string
	TargetImportPath string
}

type SourceMapFilter

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

func (*SourceMapFilter) Write

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

Directories

Path Synopsis
Package gopherjspkg provides core GopherJS packages via a virtual filesystem.
Package gopherjspkg provides core GopherJS packages via a virtual filesystem.
Package natives provides native packages via a virtual filesystem.
Package natives provides native packages via a virtual filesystem.

Jump to

Keyboard shortcuts

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