Closed MaxPleaner closed 7 years ago
This isn't really possible. Sweet doesn't just check validity at the end of expansion, parsing of the JavaScript grammar is entwined with expansion in order to get hygiene and all the grammar matching correct.
If you want to render the AST to something other than JavaScript you could always use Sweet's parse
function to get just the AST and then do an AST transform and codegen to whatever you target is.
Closing this issue since I don't think we can do anything.
I would like to output coffeescript using sweetjs. The functionality seems to all be there, the only thing not working is that the output is checked in order to verify that it's valid JS.
Also, it seems to be somewhat coerced into JS, too, which I wouldn't want in this case. For example:
outputs:
I'm not asking for a check for if the output is valid language X; but I do think it'd be beneficial if there was an option to turn off output linting. This would enable the project to be used to convert Javascript source to a larger range of outputs.