diff options
| author | Taylan Kammer <taylan.kammer@gmail.com> | 2026-06-06 00:45:09 +0200 |
|---|---|---|
| committer | Taylan Kammer <taylan.kammer@gmail.com> | 2026-06-06 00:45:09 +0200 |
| commit | ab1076f0fbee5df6fc5d3a8771070d79154d1e19 (patch) | |
| tree | ce3bdf782d6d0e9b11bdfc0741bad2cc095e581f /src | |
| parent | 3a66abbf1d54c441828d48a29dbed9fdde68da5b (diff) | |
Parser interning now optional.
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); } |
