Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix for #93
This does fix the repro case I found, and it seems technically better. That said, the failure case was extremely basic, so I'm still a bit concerned; but this is definitely an improvement. Changes:
(1) Most places that check against "Set" also need to check against "OpSet"
(1a) When I changed set_variables to check OpSet too, I need to make it note that OpSet also accesses the variable's original value
(1b) This is fine, it won't improperly detect accesses because the later circular reference checker will filter them out... except the circular reference was improperly not detecting OpSet's as circular.
(2) I changed the representation of the OpSet node produced by the parser to match the Set node, such that they can be used by shared code. In particular, OpSet now passes out the lhs/rhs as tables of values rather than single values, even though OpSet doesn't support multiple assignment. Also, I changed the order from {operator, lhs, rhs} to {lhs, rhs, operator} to allow using OpSet nodes wherever Set nodes are used. (Set nodes are {lhs, rhs}.)
I still don't have access to a large crashing codebase, thus the lack of confidence. The first few repos I tested this on, e.g. https://github.com/NobleRobot/NobleEngine, didn't crash even under the previous version.