Conversation
chore: update stale octalide URLs to briar-systems
Move the streaming ASCII escaper from the mach compiler's mach.cli.json into std.data.json as the one JSON emission home, and unify it with the tree emitter's structural escaper into a single escape core. escape_unit takes an explicit policy: ESCAPE_VERBATIM (structural, UTF-8 bytes verbatim) drives the tree emitter emit(); ESCAPE_ENSURE_ASCII (RFC 3629 decode to \uXXXX, astral surrogate pairs, U+FFFD on invalid input) drives the streaming surface. The tree emitter now renders through a counting io.Writer (BufWriter) so both surfaces share one sink and one escaper; emit() keeps its measure-when-short semantics. Add the streaming NDJSON surface (Object, object_begin/object_end, field_str/field_str_or_null/field_i64/field_bool, write_json_string) ported verbatim from mach.cli.json, with its exact-byte tests plus a full-object call-sequence test. Tree and streaming output are byte-identical to their pre-unification form. The #337/#340 parse/emit representation asymmetry warnings are preserved. Closes #338
…ters Re-port the streaming NDJSON surface from the current mach dev, which mach#1838 extended past the flat-object surface the first port captured. Add the Array record and the nesting primitives object_end_value, field_object_begin, field_array_begin, array_end, array_object_begin, and field_null, ported verbatim with their Object.first / Array.first comma-state machine intact. object_end now closes via object_end_value and writes the sole NDJSON line terminator, so a whole nested object still lands on one line. Port mach#1838's exact-byte compose tests (nested object + array-of- objects, empty array) and exercise field_null in the flat sequence test. The full public surface and byte output match the compiler's current mach.cli.json, so the mach-side rewire is a use swap.
…itter feat(data/json): unify JSON escapers and add streaming NDJSON emitter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release dev -> main. Two merges since the auxv-page-size release:
std.data.jsongains the streaming NDJSON emitter surface (Object/Array primitives, nested objects, arrays-of-objects) ported 1:1 from the mach compiler'smach.cli.json, and the tree emitter's structural escaper and the streaming ensure-ascii escaper are unified into one private escape core with an explicit policy knob. Byte-identity to the compiler's emitter proven by ported exact-byte tests (588 tests green). Enables the mach-side removal ofmach.cli.json(the compiler half of mach-std#338).The #337/#340 parse/emit asymmetry warnings are preserved; #340 remains open.