| ... | @@ -540,6 +540,7 @@ const DocData = struct { | ... | @@ -540,6 +540,7 @@ const DocData = struct { |
| 540 | }, | 540 | }, |
| 541 | array: Array, | 541 | array: Array, |
| 542 | call: usize, // index in `calls` | 542 | call: usize, // index in `calls` |
| | 543 | enumLiteral: []const u8, |
| 543 | | 544 | |
| 544 | const Struct = struct { | 545 | const Struct = struct { |
| 545 | typeRef: TypeRef, | 546 | typeRef: TypeRef, |
| ... | @@ -613,6 +614,11 @@ const DocData = struct { | ... | @@ -613,6 +614,11 @@ const DocData = struct { |
| 613 | options, | 614 | options, |
| 614 | w, | 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 | // try w.print("{ len: {},\n", .{v.len}); | 623 | // try w.print("{ len: {},\n", .{v.len}); |
| 618 | | 624 | |
| ... | @@ -685,7 +691,11 @@ fn walkInstruction( | ... | @@ -685,7 +691,11 @@ fn walkInstruction( |
| 685 | | 691 | |
| 686 | return new_file_walk_result; | 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 | .int => { | 699 | .int => { |
| 690 | const int = data[inst_index].int; | 700 | const int = data[inst_index].int; |
| 691 | return DocData.WalkResult{ | 701 | return DocData.WalkResult{ |