10 Commits

Author SHA1 Message Date
e8ddee5ab2
examples.reify: implement updated union/enum semantics 2023-11-06 20:45:04 -08:00
f371aa281c
parser: default expect enum values with leading .
I prefer this, personally. And this is all about personal preference.
2023-10-22 16:48:45 -07:00
ce65dee71f
parser: ostensibly fix sentinel handling
I guess arrays don't need special handling because their memory is
explicitly accounted for, but it would probably be good to check that
a sentinel-terminated array initialized as `undefined` does get the
correct sentinel value.
2023-10-22 16:38:41 -07:00
f371f16e2f
slam dunk that minimum viable product vibe 2023-10-22 16:16:57 -07:00
6d2c08878d
examples: add parsing to an object example 2023-10-22 15:36:34 -07:00
01f98f9aff
parser: start the arduous journey of hooking up diagnostics
The errors in the line buffer and tokenizer now have diagnostics. The
line number is trivial to keep track of due to the line buffer, but
the column index requires quite a bit of juggling, as we pass
successively trimmed down buffers to the internals of the parser.
There will probably be some column index counting problems in the
future. Also, handling the diagnostics is a bit awkward, since it's a
mandatory out-parameter of the parse functions now. The user must
provide a valid diagnostics object that survives for the life of the
parser.
2023-09-27 23:44:06 -07:00
0e60719c85
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.
2023-09-26 00:06:39 -07:00
7f82c24584
parser: implement streaming parser
With my pathological 50MiB 10_000 line nested list test, this is
definitely slower than the one shot parser, but it has peak memory
usage of 5MiB compared to the 120MiB of the one-shot parsing. Not bad.
Obviously this result is largely dependent on the fact that this
particular benchmark is 99% whitespace, which does not get copied into
the resulting document. A (significantly) smaller improvement will be
observed in files that are mostly data with little indentation or
empty lines.

But a win is a win.
2023-09-25 01:18:09 -07:00
5037f69fbe
examples: add some sample documents to parse against 2023-09-24 22:25:22 -07:00
8684fab23c
build: add oneshot parsing example 2023-09-24 15:14:58 -07:00