diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/zisp/io/Parser.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/zisp/io/Parser.zig b/src/zisp/io/Parser.zig index 3ac0d8c..490b231 100644 --- a/src/zisp/io/Parser.zig +++ b/src/zisp/io/Parser.zig @@ -89,7 +89,7 @@ pub const Context = struct { }; alloc: Alloc, -istr_set: *IstrSet, +istr_set: ?*IstrSet, pair_pool: *PairPool, input: *std.Io.Reader = undefined, @@ -112,7 +112,7 @@ pub fn initCustom( alloc: Alloc, init_ctx_stack_cap: usize, init_str_chars_cap: usize, - istr_set: *IstrSet, + istr_set: ?*IstrSet, pair_pool: *PairPool, ) !Parser { var p: Parser = .{ @@ -194,8 +194,8 @@ fn getCharsAsString(p: *Parser) !Value { const s = p.chars.items; return if (value.sstr.isValidSstr(s)) value.sstr.pack(s) - else if (value.istr.isValidIstr(s)) - value.istr.internInSet(p.istr_set, s) + else if (value.istr.isValidIstr(s) and p.istr_set != null) + value.istr.internInSet(p.istr_set.?, s) else value.array.newString(p.alloc, s); } |
