You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to get the length of a match inside the .pest file?
use case:
I would like to match nested blocks of the following form:
<<<<
outer
<<<
inner
>>>
>>>>
The outer part should have at least one more start and end element than the inner one. It should be possible to support indefinite numbers of nesting.
With repetition and stack I would know how to achieve this if the start and end tag would be the same, but not with different elements. For this, I think I would need to know the length of the start and use it in the repetition of the end.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Is it possible to get the length of a match inside the .pest file?
use case:
I would like to match nested blocks of the following form:
The outer part should have at least one more start and end element than the inner one. It should be possible to support indefinite numbers of nesting.
With repetition and stack I would know how to achieve this if the start and end tag would be the same, but not with different elements. For this, I think I would need to know the length of the start and use it in the repetition of the end.
Any help is greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions