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

dump formulas in source order #172

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

dump formulas in source order #172

wants to merge 1 commit into from

Conversation

digama0
Copy link
Member

@digama0 digama0 commented Oct 28, 2024

Printing in hashmap order is bad because it is both visibly random and also nondeterministic.

Comment on lines +1743 to +1745
let Some(formula) = sps.formulas.get(&sref.address()) else {
continue;
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we .unwrap() instead of else { continue; } ?
A formula stored in the wrong segment is an internal bug which should not be just ignored IMO.

Copy link
Member Author

@digama0 digama0 Oct 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I think this one is a continue because sref is looping over all statements, including comments, $d declarations, and other random junk. Presumably only some of them actually have formulas associated to them. If you prefer we could do some other check like is_statement() to guard the continue and then assert everything that remains is in sps.formulas.

@tirix
Copy link
Collaborator

tirix commented Oct 28, 2024

I agree with the principle.
One minor remark.

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

Successfully merging this pull request may close these issues.

2 participants