2026-07-25 12:39:32 +02:00
|
|
|
internal import CPlaydate
|
|
|
|
|
|
|
|
|
|
extension Lua {
|
2026-09-18 13:15:08 +00:00
|
|
|
/// The type of a value on the Lua stack. Wraps `LuaType`.
|
2026-07-25 12:39:32 +02:00
|
|
|
public enum Kind: UInt32, Sendable {
|
2026-09-18 13:15:08 +00:00
|
|
|
/// Also used for unrecognized type codes.
|
2026-07-25 12:39:32 +02:00
|
|
|
case `nil` = 0
|
|
|
|
|
case bool = 1
|
|
|
|
|
case int = 2
|
|
|
|
|
case float = 3
|
|
|
|
|
case string = 4
|
|
|
|
|
case table = 5
|
|
|
|
|
case function = 6
|
2026-09-18 13:15:08 +00:00
|
|
|
/// A coroutine.
|
2026-07-25 12:39:32 +02:00
|
|
|
case thread = 7
|
2026-09-18 13:15:08 +00:00
|
|
|
/// Userdata.
|
2026-07-25 12:39:32 +02:00
|
|
|
case object = 8
|
|
|
|
|
|
|
|
|
|
init(_ type: LuaType) { self = Kind(rawValue: UInt32(type.rawValue)) ?? .nil }
|
|
|
|
|
}
|
|
|
|
|
}
|