compiler

package
v0.0.0-...-fce0ec3 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2020 License: BSD-2-Clause Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const GoVersion = 12

GoVersion is the current Go 1.x version that GopherJS is compatible with.

View Source
const Version = "1.12-3"

Version is the GopherJS compiler version string.

Variables

This section is empty.

Functions

func CheckGoVersion

func CheckGoVersion(goroot string) error

CheckGoVersion checks the version of the Go distribution at goroot, and reports an error if it's not compatible with this version of the GopherJS compiler.

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, 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 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