Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any interest in pegjs-template features? #7

Open
sethfowler opened this issue Dec 3, 2022 · 3 comments
Open

Any interest in pegjs-template features? #7

sethfowler opened this issue Dec 3, 2022 · 3 comments

Comments

@sethfowler
Copy link

I just discovered peggyjs. Really nice work!

This peggy-tag library plays a similar role to my pegjs-template library for PEG.js. I'd love to contribute the features from that library to this one. In particular, I'd be interested in contributing:

  1. The ability to interpolate in functions and use them as semantic actions. This allows you to get syntax highlighting and type checking for semantic actions, to use TypeScript in them, to capture JavaScript variables, etc etc. This isn't just interpolating the functions' source as a string; that would prevent things like capturing variables. Instead, under the hood, the functions are passed in to the parser via the grammar context.
  2. The ability to define "partial" grammars that you can interpolate into other grammars, allowing you to share common definitions across multiple grammars. I find this pretty useful for lexical stuff in particular. Again, this isn't just interpolating the shared definitions as a string, because we want to take functions along for the ride.

I've found these features quite useful in my own work. What do you think; do these feel like a good fit for peggy-tag?

@sethfowler
Copy link
Author

I'll take the silence here as a "no" and close this issue, but please don't hesitate to reach out if there's interest.

@hildjj
Copy link
Contributor

hildjj commented Jan 3, 2023

Sorry I didn't get back to you in a timely fashion, I've been on the road for several weeks. I'm open to including these features, if you're still willing to contribute. Doing a release of peggy-tag is waiting on the next version of Peggy, so I'll turn my attention there next, hopefully.

@hildjj hildjj reopened this Jan 3, 2023
@hildjj
Copy link
Contributor

hildjj commented Dec 3, 2023

... and I finally got around to a release, much later than I should have.

I'm ready to take any of those changes if you're still interested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants