| ... | ... | @@ -82,6 +82,8 @@ pub const Node = struct { |
| 82 | 82 | options: std.fmt.FormatOptions, |
| 83 | 83 | writer: anytype, |
| 84 | 84 | ) !void { |
| 85 | _ = fmt; |
| 86 | _ = options; |
| 85 | 87 | if (self.directive) |id| { |
| 86 | 88 | try std.fmt.format(writer, "{{ ", .{}); |
| 87 | 89 | const directive = self.base.tree.tokens[id]; |
| ... | ... | @@ -125,6 +127,8 @@ pub const Node = struct { |
| 125 | 127 | options: std.fmt.FormatOptions, |
| 126 | 128 | writer: anytype, |
| 127 | 129 | ) !void { |
| 130 | _ = fmt; |
| 131 | _ = options; |
| 128 | 132 | try std.fmt.format(writer, "{{ ", .{}); |
| 129 | 133 | for (self.values.items) |entry| { |
| 130 | 134 | const key = self.base.tree.tokens[entry.key]; |
| ... | ... | @@ -159,6 +163,8 @@ pub const Node = struct { |
| 159 | 163 | options: std.fmt.FormatOptions, |
| 160 | 164 | writer: anytype, |
| 161 | 165 | ) !void { |
| 166 | _ = fmt; |
| 167 | _ = options; |
| 162 | 168 | try std.fmt.format(writer, "[ ", .{}); |
| 163 | 169 | for (self.values.items) |node| { |
| 164 | 170 | try std.fmt.format(writer, "{}, ", .{node}); |
| ... | ... | @@ -174,7 +180,10 @@ pub const Node = struct { |
| 174 | 180 | |
| 175 | 181 | pub const base_tag: Node.Tag = .value; |
| 176 | 182 | |
| 177 | | pub fn deinit(self: *Value, allocator: *Allocator) void {} |
| 183 | pub fn deinit(self: *Value, allocator: *Allocator) void { |
| 184 | _ = self; |
| 185 | _ = allocator; |
| 186 | } |
| 178 | 187 | |
| 179 | 188 | pub fn format( |
| 180 | 189 | self: *const Value, |
| ... | ... | @@ -182,6 +191,8 @@ pub const Node = struct { |
| 182 | 191 | options: std.fmt.FormatOptions, |
| 183 | 192 | writer: anytype, |
| 184 | 193 | ) !void { |
| 194 | _ = fmt; |
| 195 | _ = options; |
| 185 | 196 | const start = self.base.tree.tokens[self.start.?]; |
| 186 | 197 | const end = self.base.tree.tokens[self.end.?]; |
| 187 | 198 | return std.fmt.format(writer, "{s}", .{ |
| ... | ... | @@ -563,7 +574,6 @@ const Parser = struct { |
| 563 | 574 | if (self.eatToken(.SingleQuote)) |_| { |
| 564 | 575 | node.start = node.start.? + 1; |
| 565 | 576 | while (true) { |
| 566 | | const pos = self.token_it.pos; |
| 567 | 577 | const tok = self.token_it.next(); |
| 568 | 578 | switch (tok.id) { |
| 569 | 579 | .SingleQuote => { |
| ... | ... | @@ -579,7 +589,6 @@ const Parser = struct { |
| 579 | 589 | if (self.eatToken(.DoubleQuote)) |_| { |
| 580 | 590 | node.start = node.start.? + 1; |
| 581 | 591 | while (true) { |
| 582 | | const pos = self.token_it.pos; |
| 583 | 592 | const tok = self.token_it.next(); |
| 584 | 593 | switch (tok.id) { |
| 585 | 594 | .DoubleQuote => { |
| ... | ... | @@ -594,7 +603,6 @@ const Parser = struct { |
| 594 | 603 | |
| 595 | 604 | // TODO handle multiline strings in new block scope |
| 596 | 605 | while (true) { |
| 597 | | const pos = self.token_it.pos; |
| 598 | 606 | const tok = self.token_it.next(); |
| 599 | 607 | switch (tok.id) { |
| 600 | 608 | .Literal => {}, |