diff --git a/src/parser/state.zig b/src/parser/state.zig index b0c3c99..044d6e8 100644 --- a/src/parser/state.zig +++ b/src/parser/state.zig @@ -199,9 +199,9 @@ pub const State = struct { .in_line => |in_line| switch (in_line) { .empty => unreachable, inline .line_string, .space_string, .concat_string => |str, tag| { - if (tag == .line_string) + if (comptime tag == .line_string) try state.string_builder.append(arena_alloc, '\n'); - if (tag == .space_string) + if (comptime tag == .space_string) try state.string_builder.append(arena_alloc, ' '); try state.string_builder.appendSlice(arena_alloc, str); }, diff --git a/src/parser/value.zig b/src/parser/value.zig index 0811889..191b8ce 100644 --- a/src/parser/value.zig +++ b/src/parser/value.zig @@ -223,10 +223,10 @@ pub const Value = union(enum) { } } } else { - // we could iterate over each map key and do an exhaustive - // comparison with each struct field name. This would save - // memory and it would probably be a fair amount faster for - // small structs. + // TODO: consider not cloning the map here. This would + // result in the requirement that the raw value object + // not be used after it has been converted to a type, + // based on the parse options. var clone = try map.clone(); defer clone.deinit(); inline for (stt.fields) |field| {