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

Importing grammar rules from a file #298

Closed
jarble opened this issue Jun 13, 2022 · 4 comments
Closed

Importing grammar rules from a file #298

jarble opened this issue Jun 13, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@jarble
Copy link

jarble commented Jun 13, 2022

I often re-use the same grammar rules in multiple grammar files, so I want to save these rules in one file and import them into other grammar files.

If I defined a rule in a file named rules.peggy:

function_call = a1:var_name "(" _ a2:exprs _ ")" {return a1+"("+a2+")";}

I would want to import it into another grammar file:

import rules.peggy

Does Peggy have a feature that allows grammar rules to be imported like this?

@hildjj
Copy link
Contributor

hildjj commented Jun 13, 2022

We're currently talking about it here, and in a draft PR that isn't finished yet.

@hildjj
Copy link
Contributor

hildjj commented Dec 13, 2023

Also #417

@hildjj
Copy link
Contributor

hildjj commented Jan 27, 2024

I think #456 is the full fix for this.

@hildjj
Copy link
Contributor

hildjj commented Jan 27, 2024

Fixed by #456

@hildjj hildjj closed this as completed Jan 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants