Documentation ¶
Index ¶
- Variables
- func AutoConvert(v reflect.Value, t reflect.Type) reflect.Value
- func GoModuleList() []string
- func GoModuleName(table map[string]interface{}) (name string, ok bool)
- func Import(mod string, table map[string]interface{})
- func SetAutoCall(t reflect.Type)
- func SetDontTyNormalize(t reflect.Type)
- func SetDumpStack(dump bool)
- type Chan
- type DataIndex
- type GoTyper
- type Module
- type Type
- type TypeEx
Constants ¶
This section is empty.
Variables ¶
var ( ChanIn = dummyChanIn ChanOut = dummyChanOut MakeChan = dummyMakeChan GetEx = dummy2 SetIndex = dummySetIndex MapInit = dummyN MapFrom = dummyN Map = dummy2 Slice = dummy1 SliceFrom = dummyN SliceFromTy = dummyN StructInit = dummyN SubSlice = dummy3 ChanOf = dummy1 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 )
var ( // DumpStack indicates to dump stack when error. DumpStack = false // AutoCall is reserved for internal use. AutoCall = make(map[reflect.Type]bool) // DontTyNormalize is reserved for internal use. DontTyNormalize = make(map[reflect.Type]bool) )
var Fntable = map[string]interface{}{
"$neg": dummy1,
"$elem": 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.
var SafeMode bool
SafeMode is the init mode of qlang.
var (
// Undefined is `undefined` in qlang.
Undefined interface{} = undefinedType(0)
)
Functions ¶
func AutoConvert ¶
AutoConvert converts a value to specified type automatically.
func GoModuleList ¶
func GoModuleList() []string
GoModuleList returns qlang modules implemented by Go.
func GoModuleName ¶
GoModuleName returns name of a qlang module.
func SetDontTyNormalize ¶
SetDontTyNormalize is reserved for internal use.
Types ¶
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{}
}
A Module represents a qlang module to be imported.
type Type ¶
type Type struct {
// contains filtered or unexported fields
}
A Type represents a qlang builtin type.
func (*Type) NewInstance ¶
func (p *Type) NewInstance(args ...interface{}) interface{}
NewInstance creates a new instance of a qlang type. required by `qlang type` spec.
type TypeEx ¶
type TypeEx struct { Call interface{} // contains filtered or unexported fields }
A TypeEx represents a qlang builtin type with a cast function.
func StructOfEx ¶
func StructOfEx(ptr interface{}, cast interface{}) *TypeEx
StructOfEx returns a qlang builtin type object with a cast function.
func (*TypeEx) NewInstance ¶
func (p *TypeEx) NewInstance(args ...interface{}) interface{}
NewInstance creates a new instance of a qlang type. required by `qlang type` spec.