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

Display PlusCal translator warnings in the toolbox interface #631

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

ztlpn
Copy link

@ztlpn ztlpn commented May 27, 2021

This PR is in preparation for #624

Currently PCal translator doesn't emit many warnings (namely two: "symbols were renamed" and a warning about conflicting fairness options if --fair algorithm has been specified) but I think it still makes sense to display them (and possible future warnings) in the toolbox interface.

This also fixes a small bug where PCal warning messages didn't get their own message in ToolIO and instead got coalesced the next message.

@ztlpn
Copy link
Author

ztlpn commented May 27, 2021

Re: #624 (comment)

By "the new warning" do you mean the warning about the dangling blocks or the warning about conflicting fairness options? The latter one isn't new :) anyway it is triggered by

------------------------------ MODULE warning ------------------------------

(*
PlusCal options (-nof)

--fair algorithm test
variables x = FALSE;
begin
    x := TRUE;
end algorithm;
*)

=============================================================================

If you wish, I can add it to test cases – at the very least it would test that warnings are properly registered in ToolIO.

Also there is a warning generated when identical labels in different processes are renamed. Which is a bit superfluous in my opinion - info about label renames also is written into the translation header. But I can leave it as-is.

As far as I can see, there are no other warnings in the existing code.

@lemmy
Copy link
Member

lemmy commented May 27, 2021

Yes, please add the test you're proposing. I've always found the warning at the translation header sufficient. Perhaps, create a new issue once the current one is addressed?

@@ -45,9 +45,6 @@ public void removeNameConflicts() throws RemoveNameConflictsException
}

st.Disambiguate();
if (st.disambiguateReport.size() > 0)
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure we should roll this change into this PR for backward compatibility reasons. Is there a reason for removal besides it being annoying?

Copy link
Author

Choose a reason for hiding this comment

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

No other reason. I'll revert it then.

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.

None yet

2 participants