From 36d0afbf2871ddaa6717807ae0050cb06cb2cd0d Mon Sep 17 00:00:00 2001 From: mlugg Date: Fri, 1 Mar 2024 06:02:25 +0000 Subject: [PATCH] Autodoc: handle more direct int value Refs --- src/Autodoc.zig | 48 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/src/Autodoc.zig b/src/Autodoc.zig index 480651fb20..9e8ec9a469 100644 --- a/src/Autodoc.zig +++ b/src/Autodoc.zig @@ -5669,6 +5669,42 @@ fn walkRef( .expr = .{ .int = .{ .value = 1 } }, }; }, + .negative_one => { + return DocData.WalkResult{ + .typeRef = .{ .type = @intFromEnum(Ref.comptime_int_type) }, + .expr = .{ .int = .{ .value = 1, .negated = true } }, + }; + }, + .zero_usize => { + return DocData.WalkResult{ + .typeRef = .{ .type = @intFromEnum(Ref.usize_type) }, + .expr = .{ .int = .{ .value = 0 } }, + }; + }, + .one_usize => { + return DocData.WalkResult{ + .typeRef = .{ .type = @intFromEnum(Ref.usize_type) }, + .expr = .{ .int = .{ .value = 1 } }, + }; + }, + .zero_u8 => { + return DocData.WalkResult{ + .typeRef = .{ .type = @intFromEnum(Ref.u8_type) }, + .expr = .{ .int = .{ .value = 0 } }, + }; + }, + .one_u8 => { + return DocData.WalkResult{ + .typeRef = .{ .type = @intFromEnum(Ref.u8_type) }, + .expr = .{ .int = .{ .value = 1 } }, + }; + }, + .four_u8 => { + return DocData.WalkResult{ + .typeRef = .{ .type = @intFromEnum(Ref.u8_type) }, + .expr = .{ .int = .{ .value = 4 } }, + }; + }, .void_value => { return DocData.WalkResult{ @@ -5700,18 +5736,6 @@ fn walkRef( .empty_struct => { return DocData.WalkResult{ .expr = .{ .@"struct" = &.{} } }; }, - .zero_usize => { - return DocData.WalkResult{ - .typeRef = .{ .type = @intFromEnum(Ref.usize_type) }, - .expr = .{ .int = .{ .value = 0 } }, - }; - }, - .one_usize => { - return DocData.WalkResult{ - .typeRef = .{ .type = @intFromEnum(Ref.usize_type) }, - .expr = .{ .int = .{ .value = 1 } }, - }; - }, .calling_convention_type => { return DocData.WalkResult{ .typeRef = .{ .type = @intFromEnum(Ref.type_type) },