-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Node type #49
Comments
It requires the upstream project to support that, see also #20 I don't think we have node type info on the AST. https://pkg.go.dev/mvdan.cc/sh/[email protected]/syntax#Node You can post a feature request issue on the upstream project instead. |
That is really unfortunate, I was hoping there would be a trick where we could include the go structure name inside the output. |
We do have a benchmark at https://github.com/un-ts/sh-syntax/blob/main/benchmark/benchmark.txt You can try it on your own machine easily by running |
Maybe you can try to add the type info at sh-syntax/processor/structs.go Lines 108 to 116 in 775b7e7
PR welcome. |
Currently, the type is added in the interface between the JS and GopherJS output and is available in property '$type' and is exploited here: https://github.com/mvdan/sh/blob/f33507475241da6fc37b972d825c351b94300bab/_js/main.go#L39. I can probably update the mapNode to have the same output as the GopherJS version. I will have a look. |
Hello,
Thank you for providing the WASM version of mvdan-sh. Is there a way to obtain the node type?
The text was updated successfully, but these errors were encountered: