-
-
Notifications
You must be signed in to change notification settings - Fork 261
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
Sharing rules between grammars? #197
Comments
Good point. There should be an import command in |
Could you provide a couple of getting started pointers and I will see if I can tackle it? |
Of course. The necessary grammar should be added to meta. Probably something like Then this should be somehow integrated into the parser and validator in the |
Resolve pest-parser#197 Example: ```rust #[derive(Parser)] #[grammar = "_base.pest"] #[grammar = "json.pest"] pub struct JSONParser; ``
Resolve pest-parser#197 Example: ```rust #[derive(Parser)] #[grammar = "_base.pest"] #[grammar = "json.pest"] pub struct JSONParser; ``` For supports sharing rules between grammars.
Resolve pest-parser#197 Example: ```rust #[derive(Parser)] #[grammar = "_base.pest"] #[grammar = "json.pest"] pub struct JSONParser; ``` For supports sharing rules between grammars.
Resolve pest-parser#197 Example: ```rust #[derive(Parser)] #[grammar = "base.pest"] #[grammar = "json.pest"] pub struct JSONParser; ``` For supports sharing rules between grammars.
Resolve #197 Example: ```rust #[derive(Parser)] #[grammar = "base.pest"] #[grammar = "json.pest"] pub struct JSONParser; ``` For supports sharing rules between grammars.
I have a few grammars for related formats / languages that share some common rules. Is there a way to readily share rules between separate grammar files?
It wouldn't make sense to just have a single big grammar file.
In
nom
, I would be able to define new combinators that I'd use for things like basic types and such.The text was updated successfully, but these errors were encountered: