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

Is there a particular reason why inlining happens _after_ checking? #3220

Open
yanok opened this issue Mar 26, 2024 · 0 comments · May be fixed by #3237
Open

Is there a particular reason why inlining happens _after_ checking? #3220

yanok opened this issue Mar 26, 2024 · 0 comments · May be fixed by #3237

Comments

@yanok
Copy link

yanok commented Mar 26, 2024

Problem

It's more a question than a FR.

Let's say I'm translating the EBNF grammar and what to keep the structure as close as possible. So I end up with a non-starter rule that can match empty input, so tree-sitter complains about it. That's actually super easily solvable, KUDOs for using a programming language to write a grammar, I can just turn these rules into functions.

But there is also this inline feature, that looks appealing, so I though I should be able to just inline these rules. Unfortunately that doesn't work: the check for rules matching an empty input is done before inlining, so tree-sitter still complains.

So, my question is: is there a particular reason for this ordering? Could we do inlining first, and then probably some bad rules will go away already?

Expected behavior

No response

@yanok yanok added the enhancement Feature request label Mar 26, 2024
@rooney rooney linked a pull request Mar 31, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants