commit b1db7d3cbf3d4f68271b580c4c9adb92f3a766fd
parent f97fe0c55e92b6097a11fa61b07c66935baa6fc3
Author: Szymon Mikulicz <szymon.mikulicz@aptiv.com>
Date: Thu, 29 Aug 2024 16:49:02 +0200
Update to zig master
Diffstat:
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/zlox/src/compiler.zig b/zlox/src/compiler.zig
@@ -78,7 +78,7 @@ pub fn Compiler(size: comptime_int) type {
};
const rules = init: {
- var new: [@typeInfo(Token).Enum.fields.len]ParseRule = undefined;
+ var new: [@typeInfo(Token).@"enum".fields.len]ParseRule = undefined;
for (&new, 0..) |*v, i| {
const T = Token;
const S = Self;
diff --git a/zlox/src/comptime_utils.zig b/zlox/src/comptime_utils.zig
@@ -2,7 +2,7 @@ const std = @import("std");
pub fn copy_const(T: type, U: type) type {
comptime var info = @typeInfo(U);
- info.Pointer.is_const = @typeInfo(T).Pointer.is_const;
+ info.pointer.is_const = @typeInfo(T).pointer.is_const;
return @Type(info);
}
@@ -12,7 +12,7 @@ pub fn typeFromTag(T: type, comptime tag: std.meta.Tag(T)) type {
}
pub fn tagFromType(T: type, U: type) std.meta.Tag(T) {
- inline for (@typeInfo(T).Union.fields) |field| {
+ inline for (@typeInfo(T).@"union".fields) |field| {
if (U == field.type) {
return @field(T, field.name);
}
@@ -21,5 +21,5 @@ pub fn tagFromType(T: type, U: type) std.meta.Tag(T) {
}
pub fn fn_error(comptime fun: anytype) type {
- return @typeInfo(@typeInfo(@TypeOf(fun)).Fn.return_type.?).ErrorUnion.error_set;
+ return @typeInfo(@typeInfo(@TypeOf(fun)).@"fn".return_type.?).error_union.error_set;
}