Versions in this module Expand all Collapse all v2 v2.0.5 Oct 3, 2023 v2.0.4 Oct 3, 2023 v2.0.3 Oct 2, 2023 v2.0.2 Oct 1, 2023 Changes in this version + var ErrorSuppress = errors.New("") + func Raise(s *lua.LState, act func() int) (ret int) v2.0.1 Sep 29, 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 ErrorSupress = errors.New("") + var ExistNode = struct{} + 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 HelpCache of topic,'?' show topics,without topic show loadable modules` + var HelpKey = "?" + var HelpPrompt = "show HelpCache 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 ...interface{}) Operator + var OpSafe = func(fn func(s *Vm)) Operator + var Option = Options + func Check(s *lua.LState, n int, def T, cast func(v lua.LValue) (val T, ok bool)) (T, bool) + func CheckBool(s *lua.LState, n int) (bool, bool) + func CheckFloat32(s *lua.LState, n int) (float32, bool) + func CheckFloat64(s *lua.LState, n int) (float64, bool) + func CheckInt(s *lua.LState, n int) (int, bool) + func CheckInt16(s *lua.LState, n int) (int16, bool) + func CheckInt32(s *lua.LState, n int) (int32, bool) + func CheckInt64(s *lua.LState, n int) (int64, bool) + func CheckRecUserData(s *lua.LState, ud *lua.LUserData, def T, cast func(v any) (val T, ok bool)) (T, bool) + func CheckString(s *lua.LState, n int) (string, bool) + func CheckUserData(s *lua.LState, n int, def T, cast func(v any) (val T, ok bool)) (T, bool) + 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 Failed(err error) + func MakePool() + func Pack(v interface{}, s *LState) LValue + func Put(s *Vm) + func Raw(v LValue) interface + func Recover(act func()) (err error) + func RecoverErr(act func() error) (err error) + func Register(m ...Modular) (err error) + func SafeFunc(fn func(state *LState) int) LGFunction + func SafeOpt(s *LState, at int, t LValueType) interface + func SafeParam(s *LState, start int, types ...LValueType) (r []interface{}) + func Success(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]interface{}) (r map[interface{}]interface{}, keys []interface{}) + 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, ...) *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]) 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]) SafeFun(name string, help string, fn LGFunction) Type[T] + func (m *BaseType[T]) SafeMethod(name string, help string, value LGFunction) Type[T] + func (m *BaseType[T]) SafeOverride(op Operate, help string, fn LGFunction) Type[T] + func (m *BaseType[T]) TopLevel() bool + func (m BaseType[T]) CanCast() bool + func (m BaseType[T]) Cast(s *LState) (T, bool) + func (m BaseType[T]) CastUserData(ud *LUserData, s *LState) (T, bool) + func (m BaseType[T]) CastVar(s *LState, n int) (T, bool) + 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) 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) SafeFun(name string, help string, fn LGFunction) Module + 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 + AddFunc func(name string, help string, fn LGFunction) Module + AddModule func(mod Modular) Module + SafeFun func(name string, help string, value LGFunction) 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_TO_STRING + 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] + 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] + CanCast func() bool + Cast func(s *LState) (T, bool) + CastUserData func(ud *LUserData, s *LState) (T, bool) + CastVar func(s *LState, n int) (T, bool) + Caster func() func(any) (T, bool) + 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] + SafeFun func(name string, help string, value LGFunction) Type[T] + SafeMethod func(name string, help string, value LGFunction) Type[T] + SafeOverride func(op Operate, help string, value LGFunction) 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/v3