JS minfier built on top of tree-sitter parser #854
Unanswered
marcel0ll
asked this question in
Show and tell
Replies: 1 comment
-
There's also this, which uses tree sitter underneath https://discourse.elm-lang.org/t/announcing-elm-optimize-level-2/6192 But I think it's only parsing for very basic things, not sure about the details. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As mentioned here I was curious about using tree-sitter for generating code and thought this would be a good way to practice some C, so I created "two" pieces of code.
One is an abstraction that allows you to 'register' some functions to be called when entering or exiting a node, based on their ts_node_type.
And the second piece of code is a javascript minifier built on top of this "visitor" abstraction as a way to test it.
Still don't know if this is useful at all, but was fun to build
tree-sitter-visitor
js-minifier
Beta Was this translation helpful? Give feedback.
All reactions