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

refactor DoSpec to not use Statement #221

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

raehik
Copy link
Collaborator

@raehik raehik commented May 10, 2022

This removes Expression's mutual recursion with Statement.

@raehik
Copy link
Collaborator Author

raehik commented May 10, 2022

I'm getting test failures related to the block analysis. uniplate behaviour has changed because with DoSpecs no longer storing a Statement, it doesn't get picked up by universeBi. I'm trying to convert DoSpecs to StExpressionAssigns to remove the need to rewrite the traversals or reconsider the AST, but it's not working.

@raehik
Copy link
Collaborator Author

raehik commented May 10, 2022

I think it's due to analyseAllLhsVars. It won't work for DoSpecifications, I need to pass it a different processor that knows to turn them into assign statements.

@raehik
Copy link
Collaborator Author

raehik commented May 10, 2022

Nope, same issue. I'm scratching my head at this - assuming there are more places where the missing StExpressionAssign causes uniplate to skip some do-related analysis

@raehik
Copy link
Collaborator Author

raehik commented May 10, 2022

Another solution would be to change ExpImpliedDo instead. But DoSpecification shouldn't store a Statement, the only thing allowed in there is StExpressionAssign (which I've essentially expanded out).

@raehik
Copy link
Collaborator Author

raehik commented May 11, 2022

The 5 failing tests are all related to DataFlow.reachingDefinitions, which calls allLhsVars, which were the problematic functions. Will spend a bit more time on this today... but if I can't solve it, I'll leave it for now.

This removes `Expression`'s mutual recursion with `Statement`.
@raehik
Copy link
Collaborator Author

raehik commented May 11, 2022

bit lost, only 2 changes seem to have any impact on test results. Leaving for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant