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

Fix 1345 attempt two #1347

Merged
merged 2 commits into from
Oct 2, 2023
Merged

Fix 1345 attempt two #1347

merged 2 commits into from
Oct 2, 2023

Conversation

MegaIng
Copy link
Member

@MegaIng MegaIng commented Sep 28, 2023

Alternative to #1346

@erezsh
Copy link
Member

erezsh commented Sep 28, 2023

I like this one better!

@MegaIng
Copy link
Member Author

MegaIng commented Sep 28, 2023

The only benefit of #1346 is that it exposes the option to skip callbacks to the end user, in case they want to do something like a deeper accepts. Otherwise I don't think there is any benefit one way or the other, except that this is less code

@erezsh
Copy link
Member

erezsh commented Sep 28, 2023

I tend to prefer this version because -

  • Using the no_callbacks option can have "potentially weird results", as you mention in the docstring. But once we add that API, it might be hard to remove it.
  • It adds complication to a function that is already fairly complicated. Without understanding the context, it's not clear why it exists.
  • Right now overriding the parser_conf is a bit awkward, but if we want to expose it to the end-user, I believe we can find a way to add an API for it. Maybe even provide a way to override the callbacks with arbitrary dictionaries, which will enable the more fearless users to do all kinds of hackable shenanigans.

Anyway, thanks for making both versions! I'll sleep on it, and if there's no new information or arguments, I'll probably merge this one.

@erezsh erezsh merged commit 35f6f1e into lark-parser:master Oct 2, 2023
9 checks passed
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

Successfully merging this pull request may close these issues.

2 participants