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

Parse from JSON? #157

Open
ejsmith opened this issue May 10, 2021 · 2 comments
Open

Parse from JSON? #157

ejsmith opened this issue May 10, 2021 · 2 comments

Comments

@ejsmith
Copy link

ejsmith commented May 10, 2021

I'm looking to build a GUI builder for conditions and simple statements. It seems like I would want to make the GUI build up an ES tree and persist that tree for when I need to go back and re-populate the visual builder UI. I don't want to create my own tree model from scratch so I'd like to be able to serialize the model to JSON which I can do using ToJsonString, but it doesn't appear that there is a way to parse that JSON back into the ES tree models. Is that correct? Any ideas on how I would go about doing this?

@lahma
Copy link
Collaborator

lahma commented May 11, 2021

Currently there's no built-in way to get back the Esprima object model from JSON, so a JsonReader version would be needed next to current writer implementation.

@jogibear9988
Copy link
Contributor

jogibear9988 commented Nov 4, 2021

@ejsmith here is a sample converter wich could be used with System.Text.Json, but it's not yet finished.
We need to add all the ast node types, make ist error tolerant and so on...
#207

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

No branches or pull requests

4 participants