qlang

package
v2.7.20+incompatible Latest Latest
Warning

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

Go to latest
Published: May 26, 2016 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ChanIn    = dummyChanIn
	ChanOut   = dummyChanOut
	GetEx     = dummy2
	SetEx     = dummySet
	SetIndex  = dummySetIndex
	MapFrom   = dummyN
	SliceFrom = dummyN
	SubSlice  = dummy3
	Xor       = dummy2
	Lshr      = dummy2
	Rshr      = dummy2
	BitAnd    = dummy2
	BitOr     = dummy2
	AndNot    = dummy2
	EQ        = dummy2
	GetVar    = dummy2
	Get       = dummy2
	Add       = dummy2
	Sub       = dummy2
	Mul       = dummy2
	Quo       = dummy2
	Mod       = dummy2
	Inc       = dummy1
	Dec       = dummy1
)
View Source
var (
	// DumpStack indicates to dump stack when error.
	DumpStack = false

	// AutoCall is reserved for internal use.
	AutoCall = make(map[reflect.Type]bool)
)
View Source
var Fntable = map[string]interface{}{
	"$neg": dummy1,
	"$mul": dummy2,
	"$quo": dummy2,
	"$mod": dummy2,
	"$add": dummy2,
	"$sub": dummy2,

	"$xor":    dummy2,
	"$lshr":   dummy2,
	"$rshr":   dummy2,
	"$bitand": dummy2,
	"$bitor":  dummy2,
	"$bitnot": dummy1,
	"$andnot": dummy2,

	"$lt":  dummy2,
	"$gt":  dummy2,
	"$le":  dummy2,
	"$ge":  dummy2,
	"$eq":  dummy2,
	"$ne":  dummy2,
	"$and": dummy2,
	"$or":  dummy2,
	"$not": dummy1,
}

Fntable is function table required by tpl.Interpreter engine.

View Source
var SafeMode bool

SafeMode is the init mode of qlang.

View Source
var (
	// Undefined is `undefined` in qlang.
	Undefined = interface{}(errors.New("undefined"))
)

Functions

func GetInitSafe

func GetInitSafe(table map[string]interface{}) (initSafe func(mod Module), ok bool)

func GoModuleList

func GoModuleList() []string

GoModuleList returns qlang modules implemented by Go.

func GoModuleName

func GoModuleName(table map[string]interface{}) (name string, ok bool)

func Import

func Import(mod string, table map[string]interface{})

Import imports a qlang module implemented by Go.

func SetAutoCall

func SetAutoCall(t reflect.Type)

SetAutoCall is reserved for internal use.

func SetDumpStack

func SetDumpStack(dump bool)

SetDumpStack set to dump stack or not.

Types

type Chan

type Chan struct {
	Data reflect.Value
}

A Chan represents chan class in qlang.

type DataIndex

type DataIndex struct {
	Data  interface{}
	Index interface{}
}

A DataIndex represents a compound data and its index. such as map[index], slice[index], object.member.

type Module

type Module struct {
	Exports map[string]interface{}
}

func (Module) Disable

func (p Module) Disable(fnNames ...string)

type Var

type Var struct {
	Name string
}

A Var represents a qlang variable.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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