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

Add syntax for function types with named parameters #784

Closed krame505 closed 1 year ago

krame505 commented 1 year ago

Changes

This adds syntax for function types with named parameters; these types existed already but there was no way of writing them explicitly. For example one could now write

synthesized attribute addProd::(Expr ::= Expr Expr; location::Location);

production intType
top::Type ::=
{
  top.addProd = addInt;  -- Instead of addInt(_, _, location=_);
}

Documentation

https://github.com/melt-umn/melt-website/pull/53