linebuffer: add strictness options

When the buffer was separated from the tokenizer, we lost some
validation, including really aggressive carriage return detection.
This brings this back in full force and adds some additional
validation on top of it.
This commit is contained in:
2023-09-26 00:06:39 -07:00
parent 7f82c24584
commit 0e60719c85
5 changed files with 201 additions and 149 deletions

View File

@@ -15,9 +15,7 @@ pub fn main() !void {
var needfree = true;
defer if (needfree) allocator.free(data);
var parser = nice.Parser{ .allocator = allocator };
const document = try parser.parseBuffer(data);
const document = try nice.parseBuffer(allocator, data, .{});
defer document.deinit();
// free data memory to ensure that the parsed document is not holding