melt-umn / silver

An attribute grammar-based programming language for composable language extensions
http://melt.cs.umn.edu/silver/
GNU Lesser General Public License v3.0
59 stars 7 forks source link

All expression contexts need their anonInh equations checked #200

Open tedinski opened 7 years ago

tedinski commented 7 years ago

This is an extremely minor bug (I bet there's 0 instances of unreported errors of this kind), so I'm not blocking the 0.4 release for it.

When we introduced production flow graphs, they were for productions. Those are the only things involved in flow type inference. Then, when we matured error checking and the supported features to include decorate and case fully, we realized that we had to create the now-misnamed production flow graphs for functions, too.

After a careful review, I've realized they're necessary for "anonymous contexts" like global declarations and expressions within action blocks, too. Basically, flowDefs started to come from expressions, too, not just equations. So we need to add generation of flow graphs for these... things that need a better name than "anonymous contexts".

Then as a final refactoring the prodFlowGraph attribute on BlockContext doesn't need to be a Maybe anymore, because there should always be one.

tedinski commented 5 years ago

309 should fix what's described above, however it doesn't fully solve the problem.

To finish things, we need to actually do checkAllEqDeps anywhere expressions might appear. The purpose is to look for the equations involved in decorate (and thus part of pattern matching, typically, too.)

I've added a comment to the bottom of Inh.sv in the flow analysis. The blocker here is that many of these contexts eat their flowDefs, and that's where we'd be going to look up the existence of such equations. Also, we'd be looking them up by production name... which these contexts don't have either. So this whole thing requires some redesign of how that flow information works. I guess?

So this issue isn't done yet despite now generating flow graphs for everything.