Commit e164c29c
e164c29c06bcMerged
fc-anjos <[email protected]> · 5 months ago · 7 files · +4 added · ~3 modified
Description
Implement JSON.generate for Struct records
Emit per-Struct JSON helpers for JSON.generate and JSON.dump so record fields serialize directly from typed storage, including nullable int and string members.
Fix the parser text-AST emitter to preserve records longer than 4096 bytes; the JSON helper growth exposed the old fixed-buffer truncation by corrupting class collection during bootstrap. Document the AST format expectation and add focused JSON and parser regression coverage.
Co-Authored-By: OpenAI GPT-5 [email protected]
Details
- Commit
- e164c29c06bc
- Parent
- 7df75f7a1fb9
docs/AST.mdmodifiedView file
@@ -29,6 +29,11 @@
2929
Plain UTF-8 text, line-oriented (`\n`-terminated). Every line is one3030
record. Fields are space-separated.3131
32+
Records are not length-limited by the format. Large source constructs33+
can produce `A` records longer than 4096 bytes, so parser emitters must34+
size output records dynamically instead of formatting through a fixed35+
line buffer.36+
3237
The first record is always:3338
3439
```spinel_codegen.rbmodifiedView file
Loading diff…
spinel_parse.cmodifiedView file
Loading diff…
test/json_generate_struct_record.rbaddedView file
Loading diff…
test/json_generate_struct_record.rb.expectedaddedView file
Loading diff…
test/parser_long_ast_record.rbaddedView file
Loading diff…
test/parser_long_ast_record.rb.expectedaddedView file
Loading diff…