Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert: improve JSON converter #14

Closed
kristoff-it opened this issue Feb 29, 2024 · 1 comment
Closed

convert: improve JSON converter #14

kristoff-it opened this issue Feb 29, 2024 · 1 comment

Comments

@kristoff-it
Copy link
Owner

kristoff-it commented Feb 29, 2024

Right now the JSON converter is using std.json to parse a tree of json.Value but this way we lose line and column information when producing diagnostics.

This means that right now we print error: missing field 'foo', but we can't tell at which line and column of the original json file this field was missing (ie where the surrounding object closes).

To make this happen, we need to switch to a different approach that involves not losing information about the original token stream.

One potentially interesting solution is to start from a JSON token stream and produce a Ziggy AST.

See src/cli/convert.zig for more information.

Also see #17 for the overall goal of completing ziggy convert.

@kristoff-it
Copy link
Owner Author

Done in dd6c3cd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant