EoinDavey / tsPEG

PEG Parser Generator for TypeScript
Mozilla Public License 2.0
192 stars 7 forks source link

code generation using TypeScript api #37

Open matthewleon opened 2 years ago

matthewleon commented 2 years ago

Has there been any exploration of using the TS Compiler API (https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#user-content-creating-and-printing-a-typescript-ast) for code generation, rather than the potentially error-prone template strings in gen.ts?

EoinDavey commented 2 years ago

Hey,

This is an interesting question. There's been nothing so far no. To be honest I think there would not be enough value in it for me to invest the time required, but I agree that it would be better.

the template system is definitely the largest technical debt in tsPEG, but at the same time the simplicity is a positive.

I'll leave this issue open as I'm open to this work being done, but I don't see it happening soon