diff --git a/.gitignore b/.gitignore index 1d0753d..fa997cd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ refs/ tryout/ zig-cache/ -zig-out/ \ No newline at end of file +.zig-cache/ +zig-out/ diff --git a/src/value_parser.zig b/src/value_parser.zig index 0b31305..a779043 100644 --- a/src/value_parser.zig +++ b/src/value_parser.zig @@ -14,19 +14,19 @@ pub const ValueData = struct { pub fn getValueData(comptime T: type) ValueData { const ValueType = switch (@typeInfo(T)) { - .Optional => |oinfo| oinfo.child, + .optional => |oinfo| oinfo.child, else => T, }; return switch (@typeInfo(ValueType)) { - .Int => intData(ValueType, T), - .Float => floatData(ValueType, T), - .Bool => boolData(T), - .Pointer => |pinfo| { + .int => intData(ValueType, T), + .float => floatData(ValueType, T), + .bool => boolData(T), + .pointer => |pinfo| { if (pinfo.size == .Slice and pinfo.child == u8) { return stringData(T); } }, - .Enum => enumData(ValueType, T), + .@"enum" => enumData(ValueType, T), else => @compileError("unsupported value type"), }; } @@ -93,7 +93,7 @@ fn stringData(comptime DestinationType: type) ValueData { } fn enumData(comptime ValueType: type, comptime DestinationType: type) ValueData { - const edata = @typeInfo(ValueType).Enum; + const edata = @typeInfo(ValueType).@"enum"; return .{ .value_size = @sizeOf(DestinationType), .value_parser = struct { diff --git a/src/value_ref.zig b/src/value_ref.zig index 15374de..5b28cc4 100644 --- a/src/value_ref.zig +++ b/src/value_ref.zig @@ -57,10 +57,10 @@ pub fn allocRef(dest: anytype, alloc: Allocator) *ValueRef { pub fn mkRef(dest: anytype) ValueRef { const ti = @typeInfo(@TypeOf(dest)); - const t = ti.Pointer.child; + const t = ti.pointer.child; switch (@typeInfo(t)) { - .Pointer => |pinfo| { + .pointer => |pinfo| { switch (pinfo.size) { .Slice => { if (pinfo.child == u8) {