-
Notifications
You must be signed in to change notification settings - Fork 11
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
__copy__ implementation missing #46
Comments
I thought of a way to achieve this. One, modify the
Then, for
|
Why make |
That's a fair question. I was trying to align with the original Python implementations, which seem to have a Just a matter of preference, though. The two methods could be combined, or |
I think it's a good idea to stick to the Python structure whenever it makes sense. But in Python |
Roger that - so something like:
|
Yes, that looks better! |
Hi, me again.
It looks like the dunder
__copy__
methods are not carried over to Javascript:lalr_interactive_parser.py:61
lalr_parser_state.py:56
Presumably, other dunder methods like
__eq__
are not available, though I haven't checked.In practice, this results in different outcomes when running
accepts
. Specifically,parser_state.state_stack
grows with the previous token IDs instead of maintaining independent copies.A fix for my specific issue here looks like this:
Which successfully maintains independent
state_stack
copies.However, this wouldn't solve other outstanding references to dunder methods.
The text was updated successfully, but these errors were encountered: