Not sure if there's a better way of doing this, but then I serialise the AST into a JSON, 's JSON encoder will encode the struct of each node, but I miss the type.

I want to include the node type.

For now this is fine. The JSON is readable and it works fine when I want to check something in the AST. So WIN! 🎉

Follow

LOL!

I did a search and I found this: jhall.io/posts/go-json-tricks-

So looks like I may be right after all!

Sign in to participate in the conversation
Mastodon @ SDF

"I appreciate SDF but it's a general-purpose server and the name doesn't make it obvious that it's about art." - Eugen Rochko