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

Separate [Message]s by an "analysis name" #782

Open
remexre opened this issue Aug 7, 2023 · 0 comments
Open

Separate [Message]s by an "analysis name" #782

remexre opened this issue Aug 7, 2023 · 0 comments

Comments

@remexre
Copy link
Member

remexre commented Aug 7, 2023

If we want to filter the errors we're producing, we're currently (e.g. in the flow analysis) doing this by passing down some flags saying whether to produce an error or not. We could avoid all this flag-passing and simplify some logic by instead always producing those errors and filtering them out at the top.

To avoid running analyses that we don't want to run, for performance or circularity reasons, we need to be able to skip entire sublists; this suggests that maybe errors should be something like:

nonterminal Analysis;
annotation analysisName :: String occurs on Analysis;
annotation analysisMessages :: [Message] occurs on Analysis;

production analysis
top::Analysis ::=
{}

synthesized attribute errors :: [Analysis];

Each contribution to errors would probably look something like

top.errors <- [analysis(analysisName="tyck", analysisMessages=tyckErrors)];
monoid local tyckErrors :: [Message]; -- #781
tyckErrors <- ...;

Then, at the top, we can filter out analyses we didn't want to be run, and laziness should do the right thing for us.


I think it's a separate question as to how to use this for circularity; plausibly, we could bubble up a set of edges about which analyses are allowed to depend on which others? Honestly, having a helper like

function hasErrorsFrom
errors occurs on a =>
Boolean ::= tree::Decorated a  analysisName::String
{ return !null(concat(filter(\a -> a.analysisName == analysisName, tree.errors))); }

and using that locally might be enough.

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

No branches or pull requests

1 participant