You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was attempting to rename a symbol ap1# in a SPINAsm file with 80 lines and got a max recursion depth limit error arising from the deepcopy in Token._clone. Removing lines from the file and increasing the recursion limit both resolved the issue.
I think the problem is that by tracking the next and previous token for each token, I end up with a doubly linked list that includes every token in the program, so deep copying a single token ends up with a huge call stack, and probably being way more expensive than necessary.
I could fix this by making _clone smarter and just shallowly copying everything except for the symbol dict, but I'm tempted to just remove next_token and prev_token since I'm not currently using that functionality...
The text was updated successfully, but these errors were encountered:
I was attempting to rename a symbol
ap1#
in a SPINAsm file with 80 lines and got a max recursion depth limit error arising from the deepcopy inToken._clone
. Removing lines from the file and increasing the recursion limit both resolved the issue.I think the problem is that by tracking the next and previous token for each token, I end up with a doubly linked list that includes every token in the program, so deep copying a single token ends up with a huge call stack, and probably being way more expensive than necessary.
I could fix this by making
_clone
smarter and just shallowly copying everything except for thesymbol
dict, but I'm tempted to just removenext_token
andprev_token
since I'm not currently using that functionality...The text was updated successfully, but these errors were encountered: