Add support for extracting spec algorithms in JSON format#312
Merged
Conversation
added 4 commits
September 22, 2025 12:41
- Dump each algorithm in a separate file within the EXTRACT_LOG_DIR/algos_json directory - The AST structure follows an uppercase-lowercase structure (uppercase for node names, lowercase for property names) - Correctly serializes number literals: supports positive and negative zero, positive and negative infinity
…der for MathOpExpressionOperator
Contributor
|
Thank you for submitting this PR. I've refactored the implementation using the helper functions The only difference compared to the original implementation is in how we handle
This keeps the serialization in line with standard JSON representations for these exceptional numeric values. |
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.
Hi,
As previously discussed with @jhnaldo during ECOOP 2025 / PLSS, I've implemented a JSON protocol for ECMA-262 algorithms extracted by ESMeta, so that users can analyze their Abstract Syntax Trees in a standardized format:
nullThe JSON protocol recursively serializes algorithms and steps. Typing information is currently represented in a stringified format - I'm working on adding support for types in JSON format.
You can serialize the algorithms in JSON format by simply executing
esmeta extract -extract:log.