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 example patch tests and stop tracking prev and next tokens #15

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

aazuspan
Copy link
Owner

Closes #11

The example patch tests were broken because the parser was initialized but never run. Additionally, none of the example patches were complex enough to hit the recursion depth limit. I added a few longer patches and run the parser, which reproduced the recursion depth limit within tests.

To fix the recursion limit, which was caused by deep copying tokens, and by extension all other tokens given that they are doubly linked, I removed tracking of previous and next tokens. This was initially implemented to handle multi-word instructions by traversing to neighboring tokens, but that is now handled by TokenRegistry, and there are no other apparent use cases. If I find that I need that functionality in the future, it can be re-implemented and the _clone method can be rewritten to avoid deeply copying neighboring tokens.

The example patch tests were broken because the parser was
initialized but never run. Additionally, none of the example patches
were complex enough to hit the recursion depth limit. I added a few
longer patches and run the parser, which reproduced the recursion
depth limit within tests.

To fix the recursion limit, which was caused by deep copying tokens,
and by extension all other tokens given that they are doubly linked,
I removed tracking of previous and next tokens. This was initially
implemented to handle multi-word instructions by traversing to
neighboring tokens, but that is now handled by TokenRegistry, and
there are no other apparent use cases. If I find that I need that
functionality in the future, it can be re-implemented and the _clone
method can be rewritten to avoid deeply copying neighboring tokens.
@aazuspan aazuspan added the bug Something isn't working label Aug 13, 2024
@aazuspan aazuspan self-assigned this Aug 13, 2024
@aazuspan aazuspan merged commit 16921f1 into main Aug 13, 2024
5 checks passed
@aazuspan aazuspan deleted the recursion-limit branch August 13, 2024 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Max recursion depth when renaming symbol with addr modifier
1 participant