| ... | ... | @@ -540,6 +540,7 @@ const DocData = struct { |
| 540 | 540 | }, |
| 541 | 541 | array: Array, |
| 542 | 542 | call: usize, // index in `calls` |
| 543 | enumLiteral: []const u8, |
| 543 | 544 | |
| 544 | 545 | const Struct = struct { |
| 545 | 546 | typeRef: TypeRef, |
| ... | ... | @@ -613,6 +614,11 @@ const DocData = struct { |
| 613 | 614 | options, |
| 614 | 615 | w, |
| 615 | 616 | ), |
| 617 | .enumLiteral => |v| try std.json.stringify( |
| 618 | struct { @"enumLiteral": []const u8 }{ .@"enumLiteral" = v }, |
| 619 | options, |
| 620 | w, |
| 621 | ), |
| 616 | 622 | |
| 617 | 623 | // try w.print("{ len: {},\n", .{v.len}); |
| 618 | 624 | |
| ... | ... | @@ -685,7 +691,11 @@ fn walkInstruction( |
| 685 | 691 | |
| 686 | 692 | return new_file_walk_result; |
| 687 | 693 | }, |
| 688 | | |
| 694 | .enum_literal => { |
| 695 | const str_tok = data[inst_index].str_tok; |
| 696 | const literal = file.zir.nullTerminatedString(str_tok.start); |
| 697 | return DocData.WalkResult{ .enumLiteral = literal }; |
| 698 | }, |
| 689 | 699 | .int => { |
| 690 | 700 | const int = data[inst_index].int; |
| 691 | 701 | return DocData.WalkResult{ |