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
57 stars 7 forks source link

Make a finalType default attribute on Expr #779

Closed remexre closed 11 months ago

remexre commented 1 year ago

It looks like there are a bunch of places finalType(top) is used, sometimes even being inlined or assigned to multiple locals in different grammars. This seems like a common enough need that it might make sense to put it as an aspect default top::Expr { top.finalType = finalType(top); }, and refactor all those calls to demand it instead of repeating the computation.