| ... | @@ -3561,6 +3561,8 @@ const Writer = struct { | ... | @@ -3561,6 +3561,8 @@ const Writer = struct { |
| 3561 | assert(body.len == 0); | 3561 | assert(body.len == 0); |
| 3562 | try stream.writeAll("{}, {})"); | 3562 | try stream.writeAll("{}, {})"); |
| 3563 | } else { | 3563 | } else { |
| | 3564 | const prev_parent_decl_node = self.parent_decl_node; |
| | 3565 | if (src_node) |off| self.parent_decl_node = self.relativeToNodeIndex(off); |
| 3564 | self.indent += 2; | 3566 | self.indent += 2; |
| 3565 | if (body.len == 0) { | 3567 | if (body.len == 0) { |
| 3566 | try stream.writeAll("{}, {\n"); | 3568 | try stream.writeAll("{}, {\n"); |
| ... | @@ -3623,6 +3625,7 @@ const Writer = struct { | ... | @@ -3623,6 +3625,7 @@ const Writer = struct { |
| 3623 | try stream.writeAll(",\n"); | 3625 | try stream.writeAll(",\n"); |
| 3624 | } | 3626 | } |
| 3625 | | 3627 | |
| | 3628 | self.parent_decl_node = prev_parent_decl_node; |
| 3626 | self.indent -= 2; | 3629 | self.indent -= 2; |
| 3627 | try stream.writeByteNTimes(' ', self.indent); | 3630 | try stream.writeByteNTimes(' ', self.indent); |
| 3628 | try stream.writeAll("})"); | 3631 | try stream.writeAll("})"); |
| ... | @@ -3691,6 +3694,8 @@ const Writer = struct { | ... | @@ -3691,6 +3694,8 @@ const Writer = struct { |
| 3691 | const body = self.code.extra[extra_index..][0..body_len]; | 3694 | const body = self.code.extra[extra_index..][0..body_len]; |
| 3692 | extra_index += body.len; | 3695 | extra_index += body.len; |
| 3693 | | 3696 | |
| | 3697 | const prev_parent_decl_node = self.parent_decl_node; |
| | 3698 | if (src_node) |off| self.parent_decl_node = self.relativeToNodeIndex(off); |
| 3694 | self.indent += 2; | 3699 | self.indent += 2; |
| 3695 | if (body.len == 0) { | 3700 | if (body.len == 0) { |
| 3696 | try stream.writeAll("{}, {\n"); | 3701 | try stream.writeAll("{}, {\n"); |
| ... | @@ -3756,6 +3761,7 @@ const Writer = struct { | ... | @@ -3756,6 +3761,7 @@ const Writer = struct { |
| 3756 | try stream.writeAll(",\n"); | 3761 | try stream.writeAll(",\n"); |
| 3757 | } | 3762 | } |
| 3758 | | 3763 | |
| | 3764 | self.parent_decl_node = prev_parent_decl_node; |
| 3759 | self.indent -= 2; | 3765 | self.indent -= 2; |
| 3760 | try stream.writeByteNTimes(' ', self.indent); | 3766 | try stream.writeByteNTimes(' ', self.indent); |
| 3761 | try stream.writeAll("})"); | 3767 | try stream.writeAll("})"); |
| ... | @@ -3911,6 +3917,8 @@ const Writer = struct { | ... | @@ -3911,6 +3917,8 @@ const Writer = struct { |
| 3911 | assert(body.len == 0); | 3917 | assert(body.len == 0); |
| 3912 | try stream.writeAll("{}, {})"); | 3918 | try stream.writeAll("{}, {})"); |
| 3913 | } else { | 3919 | } else { |
| | 3920 | const prev_parent_decl_node = self.parent_decl_node; |
| | 3921 | if (src_node) |off| self.parent_decl_node = self.relativeToNodeIndex(off); |
| 3914 | self.indent += 2; | 3922 | self.indent += 2; |
| 3915 | if (body.len == 0) { | 3923 | if (body.len == 0) { |
| 3916 | try stream.writeAll("{}, {\n"); | 3924 | try stream.writeAll("{}, {\n"); |
| ... | @@ -3951,6 +3959,7 @@ const Writer = struct { | ... | @@ -3951,6 +3959,7 @@ const Writer = struct { |
| 3951 | } | 3959 | } |
| 3952 | try stream.writeAll(",\n"); | 3960 | try stream.writeAll(",\n"); |
| 3953 | } | 3961 | } |
| | 3962 | self.parent_decl_node = prev_parent_decl_node; |
| 3954 | self.indent -= 2; | 3963 | self.indent -= 2; |
| 3955 | try stream.writeByteNTimes(' ', self.indent); | 3964 | try stream.writeByteNTimes(' ', self.indent); |
| 3956 | try stream.writeAll("})"); | 3965 | try stream.writeAll("})"); |