cl

package
v1.1.0-rc1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2022 License: Apache-2.0 Imports: 21 Imported by: 2

Documentation

Overview

Package cl compiles Go+ syntax trees (ast).

Index

Constants

View Source
const (
	DbgFlagLoad = 1 << iota
	DbgFlagLookup
	DbgFlagAll = DbgFlagLoad | DbgFlagLookup
)

Variables

This section is empty.

Functions

func NewPackage added in v0.7.0

func NewPackage(pkgPath string, pkg *ast.Package, conf *Config) (p *gox.Package, err error)

NewPackage creates a Go+ package instance.

func SetDebug added in v1.0.0

func SetDebug(flags int)

func SetDisableRecover added in v1.0.0

func SetDisableRecover(disableRecover bool)

Types

type Class added in v1.1.0

type Class = modfile.Classfile

type Config added in v0.9.0

type Config struct {
	// Fset provides source position information for syntax trees and types.
	// If Fset is nil, Load will use a new fileset, but preserve Fset's value.
	Fset *token.FileSet

	// WorkingDir is the directory in which to run gop compiler.
	WorkingDir string

	// TargetDir is the directory in which to generate Go files.
	TargetDir string

	// GopRoot specifies the Go+ root directory.
	GopRoot string

	// C2goBase specifies base of standard c2go packages.
	// Default is github.com/goplus/.
	C2goBase string

	// LookupPub lookups the c2go package pubfile (named c2go.a.pub).
	LookupPub func(pkgPath string) (pubfile string, err error)

	// LookupClass lookups a class by specified file extension.
	LookupClass func(ext string) (c *Class, ok bool)

	// An Importer resolves import paths to Packages.
	Importer types.Importer

	// NoFileLine = true means not to generate file line comments.
	NoFileLine bool

	// RelativePath = true means to generate file line comments with relative file path.
	RelativePath bool

	// NoAutoGenMain = true means not to auto generate main func is no entry.
	NoAutoGenMain bool
}

Config of loading Go+ packages.

type Errors added in v0.9.2

type Errors struct {
	Errs []error
}

func (*Errors) Error added in v0.9.2

func (p *Errors) Error() string

Directories

Path Synopsis
internal
spx

Jump to

Keyboard shortcuts

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