sku_lua

package
v0.2.16 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromLuaTableTransformV1 added in v0.2.16

func FromLuaTableTransformV1(
	object *sku.Transacted,
	luaState *lua.LState,
	luaTable *LuaTableV1,
) (fieldsChanged bool, err error)

FromLuaTableTransformV1 mirrors FromLuaTableV1 (genre, id, tags, fields write-back) but additionally writes back Typ/Type. This is safe in the list-transform context -- a single-pass batch operation running before any commit begins -- unlike RFC-0006's live-commit hook context, whose FromLuaTableV1 deliberately withholds type write-back (issue #319, gated on RFC-0006 Phase 2) because that binding runs under a re-entrancy guard protecting against nested commits. No such nesting risk exists here, so this is intentionally a separate function rather than a modification to FromLuaTableV1.

func FromLuaTableV1

func FromLuaTableV1(
	object *sku.Transacted,
	luaState *lua.LState,
	luaTable *LuaTableV1,
) (fieldsChanged bool, err error)

FromLuaTableV1 writes the hook's mutations back onto object. It returns fieldsChanged when the hook altered any projected field value (RFC 0006 Phase 1 field write-back), so the commit pipeline can run its single bounded, hook-free write-back pass. Tag and id write-back are unconditional and do not affect fieldsChanged.

func FromLuaTableV2

func FromLuaTableV2(
	object *sku.Transacted,
	luaState *lua.LState,
	luaTable *LuaTableV2,
) (err error)

func ToLuaTableV1

func ToLuaTableV1(
	tg sku.TransactedGetter,
	luaState *lua.LState,
	luaTable *LuaTableV1,
)

func ToLuaTableV2

func ToLuaTableV2(
	tg sku.TransactedGetter,
	luaState *lua.LState,
	luaTable *LuaTableV2,
)

Types

type LuaTablePoolV1

type LuaTablePoolV1 = interfaces.PoolPtr[LuaTableV1, *LuaTableV1]

func MakeLuaTablePoolV1

func MakeLuaTablePoolV1(vm *lua.VM) LuaTablePoolV1

type LuaTablePoolV2

type LuaTablePoolV2 = interfaces.PoolPtr[LuaTableV2, *LuaTableV2]

func MakeLuaTablePoolV2

func MakeLuaTablePoolV2(vm *lua.VM) LuaTablePoolV2

type LuaTableV1

type LuaTableV1 struct {
	Transacted   *lua.LTable
	Tags         *lua.LTable
	TagsImplicit *lua.LTable
	Fields       *lua.LTable
}

func ToLuaArrayV1 added in v0.2.16

func ToLuaArrayV1(
	vm *lua.VM,
	tablePool LuaTablePoolV1,
	objects []*sku.Transacted,
) (array *lua.LTable, tables []*LuaTableV1, repoolAll func())

ToLuaArrayV1 projects objects into a Lua array table (1-indexed) of per-object tables, reusing ToLuaTableV1's per-object read-side projection unchanged. Returns the array plus the individual *LuaTableV1 handles (same order) -- the caller must retain these to later read mutations back via FromLuaTableTransformV1, since the array itself only exposes each element's merged Transacted table, not the Fields handle write-back needs directly.

type LuaTableV2

type LuaTableV2 struct {
	Transacted *lua.LTable

	// TODO transition to single Tags table with Tag objects that reflect
	// tag_paths.PathWithType
	Tags         *lua.LTable
	TagsImplicit *lua.LTable
}

type LuaVMPoolV1

type LuaVMPoolV1 = interfaces.PoolPtr[LuaVMV1, *LuaVMV1]

func MakeLuaVMPoolV1

func MakeLuaVMPoolV1(vmPool *lua.VMPool, self *sku.Transacted) LuaVMPoolV1

type LuaVMPoolV2

type LuaVMPoolV2 = interfaces.PoolPtr[LuaVMV2, *LuaVMV2]

func MakeLuaVMPoolV2

func MakeLuaVMPoolV2(luaVMPool *lua.VMPool, self *sku.Transacted) LuaVMPoolV2

type LuaVMV1

type LuaVMV1 struct {
	lua.LValue
	*lua.VM
	TablePool LuaTablePoolV1
	Selbst    *sku.Transacted
}

func PushTopFuncV1

func PushTopFuncV1(
	lvm LuaVMPoolV1,
	args []string,
) (vm *LuaVMV1, argsOut []string, err error)

type LuaVMV2

type LuaVMV2 struct {
	lua.LValue
	*lua.VM
	TablePool LuaTablePoolV2
	Selbst    *sku.Transacted
}

func PushTopFuncV2

func PushTopFuncV2(
	luaVMPool LuaVMPoolV2,
	args []string,
) (vm *LuaVMV2, argsOut []string, err error)

Source Files

  • lua_transacted_transform_v1.go
  • lua_transacted_v1.go
  • lua_transacted_v1_pool.go
  • lua_transacted_v2.go
  • lua_transacted_v2_pool.go

Jump to

Keyboard shortcuts

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