peggyjs / peggy

Peggy: Parser generator for JavaScript
https://peggyjs.org/
MIT License
883 stars 63 forks source link

Mjs plugins #535

Closed hildjj closed 1 week ago

hildjj commented 1 week ago

Fixes #530

hildjj commented 1 week ago

TODO: test with ts-pegjs before merging. @metadevpro might want to double-check as well.

hildjj commented 1 week ago

Todo: Don't import if the config.js has already import/required the plugin.

hildjj commented 1 week ago

Todo: Don't import if the config.js has already import/required the plugin.

That is already done and tested.

hildjj commented 1 week ago

I didn't test with ts-pegjs because of https://github.com/metadevpro/ts-pegjs/issues/122, but I'm pretty sure it's going to work after looking at the code and adding a small tweak to the loader to support (await import('ts-pegjs')).default.use.