Replies: 4 comments 3 replies
-
There is already Or if I'm misunderstanding what you mean by this, a code example would be helpful. |
Beta Was this translation helpful? Give feedback.
-
In essence, I'm trying to simplify what I see are "stub" rules in my grammar that parses Gentoo package dependencies. For example see the version rule that splits the revision parsing into a separate Is there some way to match a larger string while capturing a section of it without using separate rules? From playing around with things, I think variable scoping prevents nested action expressions or other similar hacks that could make this work, but perhaps I'm doing things wrong. |
Beta Was this translation helpful? Give feedback.
-
Action blocks don't have to be at the end of a e.g. you could inline
Of course there's a point where it gets unreadable to include too much in a single rule and it makes sense to split it up. |
Beta Was this translation helpful? Give feedback.
-
This example is a fairly common case with the subexpression inside
But I'm wary of adding more ad-hoc syntax that users would have to learn. |
Beta Was this translation helpful? Give feedback.
-
Similar to the functionality provided by pest's silent rules. In essence, silent expressions would still operate in the same fashion, but their match content would be skipped for bound actions, slices, or similar that contain them. I assume something like
silent! { e }
would probably work syntax-wise.Beta Was this translation helpful? Give feedback.
All reactions