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

[Feature Request] Support for repeatition range #310

Closed
MuhammedZakir opened this issue Aug 7, 2021 · 2 comments
Closed

[Feature Request] Support for repeatition range #310

MuhammedZakir opened this issue Aug 7, 2021 · 2 comments

Comments

@MuhammedZakir
Copy link

As in regex : e {start,end}. Of course, syntax can be different.

Specifically, I want to choose the rules based on the count of next element. For now, I hardcode the repeatition and use alternative expression. But that seems suboptimal?

@MuhammedZakir
Copy link
Author

MuhammedZakir commented Aug 7, 2021

Sorry, I didn't know there was already a discussion about this [1]. I see you have mentioned to usek semantic action. I personally think having a repeatition range operator inside grammar is better. Using semantic actions for this feel a bit "hacky" to me. For now, I am okay using semantic action.

When using AST transformer for cases like this, can I use functions/conditions to change the node type?

[1] #280


Edit: closing this as there is already an open issue about this. #215

@pdubroy
Copy link
Contributor

pdubroy commented Aug 8, 2021

@MuhammedZakir Can you add some more details about your use case to #215?

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