4 ms·
Does oxc-parser make it easy to remove comments from JavaScript? In other words does it treat comments as syntactic units, or as something that can be ignored
by galaxyLogic 8mo ago
Does oxc-parser make it easy to remove comments from JavaScript?
In other words does it treat comments as syntactic units, or as something that can be ignored wince they are not needed by the "next stage"?
The reason to find out what the comments are is of course to make it easy to remove them.
- xixixao 8mo agoShould be easy with any standard parser. See astexplorer.net
- galaxyLogic 8mo agoI've been using Esprima and it's not trivial to get rid of, or collect all comments with it. The reason is that while it finds the ranges of all syntactic JavaScript elements, it does not consider comment to be a syntactic element, but just something between them.