I want to create a formatter/linter for a custom program language and was reading about it but seems that im missing something.
Was looking/playing with PEG.js
and seems that it will do the work. Ive wrote a small parser and when ran - it correctly returns the syntax tree (AST
)
And the main question now is: how to use the generated parser to create (for example) a VSCode
/Atom
/CodeMirror
/etc. extension(s) that will beautify/format the code?
Is this the right approach in general? (using a parser or need to write specific parsers for each tool)