mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
JSON parser trailing issue fix
This commit is contained in:
committed by
Christoffer Lerno
parent
582453cb45
commit
fd9fbe26a1
@@ -26,15 +26,7 @@ fn Object*? parse(Allocator allocator, InStream s)
|
||||
JsonContext context = { .last_string = dstring::new_with_capacity(smem, 64), .stream = s, .allocator = allocator };
|
||||
@pool()
|
||||
{
|
||||
Object* o = parse_any(&context)!;
|
||||
defer catch o.free();
|
||||
while (char c = read_next(&context)!, c != 0)
|
||||
{
|
||||
if (c.is_space()) continue;
|
||||
return UNEXPECTED_CHARACTER?;
|
||||
}
|
||||
if (!@catch(context.stream.read_byte())) return UNEXPECTED_CHARACTER?;
|
||||
return o;
|
||||
return parse_any(&context)!;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user