@@ -585,34 +585,6 @@ pub fn Parsed(comptime T: type) type {
585
585
};
586
586
}
587
587
588
- const internals = [_ ][]const u8 { "toStruct" , "toSlice" , "toTuple" , "toAnyInternal" };
589
-
590
- // wrap over some internal functions of the Lua struct
591
- pub const Internals = blk : {
592
- const StructField = std .builtin .Type .StructField ;
593
- var fields : [internals .len ]StructField = undefined ;
594
- for (internals , 0.. ) | entry , i | {
595
- const F = @field (Lua , entry );
596
- const T = @TypeOf (F );
597
- fields [i ] = .{
598
- .name = @ptrCast (entry ),
599
- .type = T ,
600
- .default_value = & F ,
601
- .is_comptime = false ,
602
- .alignment = @alignOf (T ),
603
- };
604
- }
605
-
606
- const TT = @Type (.{ .@"struct" = .{
607
- .layout = .auto ,
608
- .fields = & fields ,
609
- .decls = &.{},
610
- .is_tuple = false ,
611
- } });
612
-
613
- break :blk TT {};
614
- };
615
-
616
588
/// A Zig wrapper around the Lua C API
617
589
/// Represents a Lua state or thread and contains the entire state of the Lua interpreter
618
590
pub const Lua = opaque {
@@ -4570,7 +4542,7 @@ pub const Lua = opaque {
4570
4542
/// Converts the specified index of the lua stack to the specified
4571
4543
/// type if possible and returns it
4572
4544
/// optional allocator
4573
- fn toAnyInternal (lua : * Lua , comptime T : type , a : ? std.mem.Allocator , comptime allow_alloc : bool , index : i32 ) ! T {
4545
+ pub fn toAnyInternal (lua : * Lua , comptime T : type , a : ? std.mem.Allocator , comptime allow_alloc : bool , index : i32 ) ! T {
4574
4546
const stack_size_on_entry = lua .getTop ();
4575
4547
defer {
4576
4548
if (lua .getTop () != stack_size_on_entry ) {
@@ -4771,7 +4743,7 @@ pub const Lua = opaque {
4771
4743
}
4772
4744
4773
4745
/// Converts a lua array to a zig slice, memory is owned by the caller
4774
- fn toSlice (lua : * Lua , comptime ChildType : type , a : std.mem.Allocator , raw_index : i32 ) ! []ChildType {
4746
+ pub fn toSlice (lua : * Lua , comptime ChildType : type , a : std.mem.Allocator , raw_index : i32 ) ! []ChildType {
4775
4747
const index = lua .absIndex (raw_index );
4776
4748
4777
4749
if (! lua .isTable (index )) {
@@ -4792,7 +4764,7 @@ pub const Lua = opaque {
4792
4764
}
4793
4765
4794
4766
/// Converts value at given index to a zig struct tuple if possible
4795
- fn toTuple (lua : * Lua , comptime T : type , a : ? std.mem.Allocator , comptime allow_alloc : bool , raw_index : i32 ) ! T {
4767
+ pub fn toTuple (lua : * Lua , comptime T : type , a : ? std.mem.Allocator , comptime allow_alloc : bool , raw_index : i32 ) ! T {
4796
4768
const stack_size_on_entry = lua .getTop ();
4797
4769
defer std .debug .assert (lua .getTop () == stack_size_on_entry );
4798
4770
@@ -4835,7 +4807,7 @@ pub const Lua = opaque {
4835
4807
}
4836
4808
4837
4809
/// Converts value at given index to a zig struct if possible
4838
- fn toStruct (lua : * Lua , comptime T : type , a : ? std.mem.Allocator , comptime allow_alloc : bool , raw_index : i32 ) ! T {
4810
+ pub fn toStruct (lua : * Lua , comptime T : type , a : ? std.mem.Allocator , comptime allow_alloc : bool , raw_index : i32 ) ! T {
4839
4811
const stack_size_on_entry = lua .getTop ();
4840
4812
defer std .debug .assert (lua .getTop () == stack_size_on_entry );
4841
4813
0 commit comments