authorgravatar for vallahor91@gmail.comVallahor <vallahor91@gmail.com> 2022-05-29 05:56:26-03:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-07-19 19:10:12-07:00
log1213123ad04e90d67b5c004ddc8744fe409cd839
tree83a37ab79dde69f14e2879945481baa49dd373e0
parentd23ccdb8d9e4d3510667164545f9c3be3374d529

fix: *.{} array are now printed as type *[]comptime


2 files changed, 12 insertions(+), 12 deletions(-)

lib/docs/main.js+3
......@@ -1329,6 +1329,9 @@ var zigAnalysis;
13291329 name += is_mutable;
13301330 break;
13311331 case pointerSizeEnum.Slice:
1332 if (ptrObj.is_ref) {
1333 name += "*";
1334 }
13321335 name += "[";
13331336 name += sentinel;
13341337 name += "]";
src/Autodoc.zig+9-12
......@@ -416,6 +416,7 @@ const DocData = struct {
416416 address_space: ?Expr = null,
417417 bit_start: ?Expr = null,
418418 host_size: ?Expr = null,
419 is_ref: bool = false,
419420 is_allowzero: bool = false,
420421 is_mutable: bool = false,
421422 is_volatile: bool = false,
......@@ -582,8 +583,9 @@ const DocData = struct {
582583 \\"has_align": {},
583584 \\"has_addrspace": {},
584585 \\"has_bit_range": {},
586 \\"is_ref": {},
585587 \\
586 , .{ v.is_allowzero, v.is_mutable, v.is_volatile, v.has_sentinel, v.has_align, v.has_addrspace, v.has_bit_range });
588 , .{ v.is_allowzero, v.is_mutable, v.is_volatile, v.has_sentinel, v.has_align, v.has_addrspace, v.has_bit_range, v.is_ref });
587589 if (options.whitespace) |ws| try ws.outputIndent(w);
588590 try w.print(
589591 \\"child":
......@@ -1962,17 +1964,12 @@ fn walkInstruction(
19621964 }
19631965
19641966 const type_slot_index = self.types.items.len;
1965 try self.types.append(self.arena, .{
1966 .Array = .{
1967 .len = .{
1968 .int = .{
1969 .value = operands.len - 1,
1970 .negated = false,
1971 },
1972 },
1973 .child = array_type.?,
1974 },
1975 });
1967 try self.types.append(self.arena, .{ .Pointer = .{
1968 .size = .Slice,
1969 .child = array_type.?,
1970 .is_mutable = true,
1971 .is_ref = true,
1972 } });
19761973
19771974 return DocData.WalkResult{
19781975 .typeRef = .{ .type = type_slot_index },