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