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

Provide methods to parse to/from ast.Node from structures #733

Open
scr-oath opened this issue Jan 13, 2025 · 2 comments
Open

Provide methods to parse to/from ast.Node from structures #733

scr-oath opened this issue Jan 13, 2025 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@scr-oath
Copy link

It would be convenient even if first pass is implemented as a Marshal to []byte followed by sonic.Get in one direction and MarshalJSON with sonic.Unmarshal in the other, to have methods that interoperate between golang structures and ast.Node

@AsterDY
Copy link
Collaborator

AsterDY commented Jan 15, 2025

You can use ast.NewAny() to construct one from structures ... but now Get/Set on it is not completely supported

@scr-oath
Copy link
Author

scr-oath commented Feb 4, 2025

Yeah, that's not really desired - I guess, if ast is completely disjoint from the rest of the parsing and Pretouch stuff, maybe this isn't easy, but was hoping to avoid the Marshal/Parse to create an ast from an any.

@AsterDY AsterDY added enhancement New feature or request help wanted Extra attention is needed labels Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants