diff options
| author | Theresa Foley <10618364+tangent-vector@users.noreply.github.com> | 2025-05-20 21:55:39 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-21 04:55:39 +0000 |
| commit | 9059093bc764e901a9c4aaeb12471bf32028874f (patch) | |
| tree | 7058871ce0ec4397b6e8996506357e41ebb2517d /include | |
| parent | 52d70f37f66d8fc34bc142386490bdcde0fc7db0 (diff) | |
Generalize serialization system used for AST (#7126)
This change takes the new approach to serialization that was used for the AST and generalizes it in a few ways:
* The new approach is no longer tangled up with the RIFF format.
The serialization system supports multiple different implementations of the underlying format.
The existing RIFF format is now supported as one back-end, but support for others will follow in subsequent changes.
* The new approach is no longer deeply specialized to AST serialization.
The old code had things like serialization for `List`s and `Dictionary`s, but it was embedded inside the `AST{Encoding|Decoding}Context`, and thus couldn't be leveraged for other serialization tasks.
This change factors out a completely AST-independent `Serializer` implementation, with an `ASTSerializer` layered on top of it to provide the additional context needed.
* There is less duplication of code between reading and writing of serialized data.
The old code had both the `ASTEncodingContext` and `ASTDecodingContext`, with serialization logic for most types being implemented in both, but with the constraint that those implementations needed to be kept in sync to avoid serialization-related runtime failures.
A key property of the revamped approach is that a single `serialize()` method for a type implements both the reading and writing directions of serialization.
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions
