Versions in this module Expand all Collapse all v3 v3.0.1 Oct 5, 2023 Changes in this version + var Auto = true + var BaseMod = glu(map[string]string{}) + var EagerHelpPrepare = false + var ErrAlreadyExists = errors.New("element already exists") + var ErrIndexOverrideWithMethods = errors.New("element both have methods and index overrides") + var ErrIsTop = errors.New("element is top module") + var ErrorSuppress = errors.New("") + var FmtErrMissing = "required value at %d" + var FmtErrType = "required type not match at %d" + var HelpChunk = `chunk(code,name string)(Chunk?,string?) ==> pre compile string into bytecode` + var HelpFunc = "help" + var HelpHelp = HelpFunc + `(topic string?)string? => fetch Help of topic,'?' show topics,without topic show loadable modules` + var HelpKey = "?" + var HelpPrompt = "show Help with those key word: " + var HelpTopic = `?,chunk` + var InitialSize = 4 + var OpNone = func(s *Vm) error + var OpPop = func(fn func(value ...LValue), start, count int) Operator + var OpPopN = func(count int) Operator + var OpPush = func(n ...LValue) Operator + var OpPushUserData = func(n ...any) Operator + var OpSafe = func(fn func(s *Vm)) Operator + var Option = Options + func Check(s *lua.LState, n int, cast func(v lua.LValue) (val T, ok bool)) T + func CheckBool(s *lua.LState, n int) bool + func CheckFloat32(s *lua.LState, n int) float32 + func CheckFloat64(s *lua.LState, n int) float64 + func CheckInt(s *lua.LState, n int) int + func CheckInt16(s *lua.LState, n int) int16 + func CheckInt32(s *lua.LState, n int) int32 + func CheckInt64(s *lua.LState, n int) int64 + func CheckRecUserData(s *lua.LState, ud *lua.LUserData, cast func(v any) (val T, ok bool)) T + func CheckString(s *lua.LState, n int) string + func CheckUserData(s *lua.LState, n int, cast func(v any) (val T, ok bool)) T + func CompileChunk(code string, source string) (*FunctionProto, error) + func ExecuteChunk(code *FunctionProto, argN, retN int, before Operator, after Operator) (err error) + func ExecuteCode(code string, argsN, retN int, before Operator, after Operator) error + func ExecuteFunction(fn *LFunction, argN, retN int, before Operator, after Operator) (err error) + func MakePool() + func Pack(v any, s *LState) LValue + func Put(s *Vm) + func Raise(s *lua.LState, act func() int) (ret int) + func RaiseLG(act lua.LGFunction) lua.LGFunction + func Raw(v LValue) any + func Register(m ...Modular) (err error) + func TableToMap(s *LTable) (r map[LValue]LValue) + func TableToSlice(s *LTable) (r []LValue) + func TableUnpack(s *LTable, noLua bool, history map[LValue]any) (r map[any]any, keys []any) + type BaseType struct + HelpCtor string + Mod *Mod + func NewSimpleType(name string, help string, top bool) *BaseType[T] + func NewType(name string, help string, top bool, ctorHelp string, ctor func(*LState) (v T)) *BaseType[T] + func NewTypeCast(caster func(a any) (v T, ok bool), name string, help string, top bool, ...) *BaseType[T] + func (m *BaseType[T]) AddField(name string, help string, value LValue) Type[T] + func (m *BaseType[T]) AddFieldSupplier(name string, help string, su func(s *LState) LValue) Type[T] + func (m *BaseType[T]) AddFunc(name string, help string, fn LGFunction) Type[T] + func (m *BaseType[T]) AddMethod(name string, help string, value LGFunction) Type[T] + func (m *BaseType[T]) AddMethodCast(name string, help string, act func(s *LState, data T) int) Type[T] + func (m *BaseType[T]) AddMethodUserData(name string, help string, act func(s *LState, data *LUserData) int) Type[T] + func (m *BaseType[T]) AddModule(mod Modular) Type[T] + func (m *BaseType[T]) Caster() func(any) (T, bool) + func (m *BaseType[T]) GetHelp() string + func (m *BaseType[T]) GetName() string + func (m *BaseType[T]) Override(op Operate, help string, fn LGFunction) Type[T] + func (m *BaseType[T]) OverrideCast(op Operate, help string, act func(s *LState, data T) int) Type[T] + func (m *BaseType[T]) OverrideUserData(op Operate, help string, act func(s *LState, data *LUserData) int) Type[T] + func (m *BaseType[T]) PreLoad(l *LState) + func (m *BaseType[T]) PreloadSubModule(l *LState, t *LTable) + func (m *BaseType[T]) TopLevel() bool + func (m BaseType[T]) Cast() bool + func (m BaseType[T]) Check(s *LState, n int) T + func (m BaseType[T]) CheckSelf(s *LState) T + func (m BaseType[T]) CheckUserData(ud *LUserData, s *LState) T + func (m BaseType[T]) New(l *LState, val T) int + func (m BaseType[T]) NewValue(l *LState, val T) *LUserData + type Chunk = *FunctionProto + type Mod struct + Help string + HelpCache map[string]string + Name string + Submodules []Modular + Top bool + func NewModule(name string, help string, top bool) *Mod + func (m *Mod) AddField(name string, help string, value LValue) Module + func (m *Mod) AddFieldSupplier(name string, help string, su func(s *LState) LValue) Module + func (m *Mod) AddFunc(name string, help string, fn LGFunction) Module + func (m *Mod) AddModule(mod Modular) Module + func (m *Mod) GetHelp() string + func (m *Mod) GetName() string + func (m *Mod) PreLoad(l *LState) + func (m *Mod) PreloadSubModule(l *LState, t *LTable) + func (m *Mod) TopLevel() bool + type Modular interface + GetHelp func() string + GetName func() string + PreLoad func(l *lua.LState) + PreloadSubModule func(l *lua.LState, t *lua.LTable) + TopLevel func() bool + type Module interface + AddField func(name string, help string, value LValue) Module + AddFieldSupplier func(name string, help string, su func(s *LState) LValue) Module + AddFunc func(name string, help string, fn LGFunction) Module + AddModule func(mod Modular) Module + type Operate int + const OPERATE_ADD + const OPERATE_CALL + const OPERATE_CONCAT + const OPERATE_DIV + const OPERATE_EQ + const OPERATE_INDEX + const OPERATE_INVALID + const OPERATE_LE + const OPERATE_LEN + const OPERATE_LT + const OPERATE_MOD + const OPERATE_MUL + const OPERATE_NEWINDEX + const OPERATE_POW + const OPERATE_SUB + const OPERATE_TOSTRING + const OPERATE_UNM + type Operator = func(s *Vm) error + type Prepare interface + type Type interface + AddField func(name string, help string, value LValue) Type[T] + AddFieldSupplier func(name string, help string, su func(s *LState) LValue) Type[T] + AddFunc func(name string, help string, fn LGFunction) Type[T] + AddMethod func(name string, help string, value LGFunction) Type[T] + AddMethodCast func(name string, help string, act func(s *LState, i T) int) Type[T] + AddMethodUserData func(name string, help string, act func(s *LState, u *LUserData) int) Type[T] + AddModule func(mod Modular) Type[T] + Cast func() bool + Caster func() func(any) (T, bool) + Check func(s *LState, n int) T + CheckSelf func(s *LState) T + CheckUserData func(ud *LUserData, s *LState) T + New func(l *LState, val T) int + NewValue func(l *LState, val T) *LUserData + Override func(op Operate, help string, fn LGFunction) Type[T] + OverrideCast func(op Operate, help string, act func(s *LState, i T) int) Type[T] + OverrideUserData func(op Operate, help string, act func(s *LState, u *LUserData) int) Type[T] + type Vm struct + func Get() *Vm + func (s *Vm) OpenLibsWithout(names ...string) *Vm + func (s *Vm) Polluted() (r bool) + func (s *Vm) Reset() (r *Vm) + func (s *Vm) Snapshot() *Vm + func (s *Vm) TabChildEqualTo(t1 *LTable, t2 *LTable, keys ...string) (r bool) + func (s *Vm) TabCopyChildNew(f *LTable, keys ...string) *LTable + func (s *Vm) TabCopyNew(f *LTable) *LTable + func (s *Vm) TabEqualTo(t1 *LTable, t2 *LTable) (r bool) + type VmPool struct + func CreatePool() *VmPool + func CreatePoolWith(ctor func() *LState) *VmPool + func (pl *VmPool) Get() *Vm + func (pl *VmPool) Put(L *Vm) + func (pl *VmPool) Recycle(max int) + func (pl *VmPool) Shutdown() Other modules containing this package github.com/ZenLiuCN/glu github.com/ZenLiuCN/glu/v2