seanjensengrey / kiama

Automatically exported from code.google.com/p/kiama
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Named attributes #55

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When an attribute is going "Cycle detected in attribute evaluation" it's not 
immediately obvious which one went wrong.

If we could declare attributes with:

lazy val myAttribute = attr("a name here") {
  ...
}

Then we would get:

"Cycle detected in attribute evaluation for attribute 'a name here' at ..."

Original issue reported on code.google.com by etorrebo...@gmail.com on 19 Nov 2012 at 10:01

GoogleCodeExporter commented 9 years ago

Original comment by inkytonik on 19 Nov 2012 at 11:17

GoogleCodeExporter commented 9 years ago
Implemented in rbf87fe301652 and published now to Sonatype OSS as a SNAPSHOT of 
1.4.0-B5. Please let me know if it works for you.

Each of the attribute creation methods (attr, paramAttr, childAttr, tree, 
circular and constant) now optionally take a first parameter list containing a 
string (as in the example above). If present, the name is used in messages 
produced when a cycle is detected.

All attribute types are supported even if they can't involve a cycle so that we 
have a consistent basis for future debugging and profiling additions which will 
also use the names.

Original comment by inkytonik on 3 Dec 2012 at 6:06

GoogleCodeExporter commented 9 years ago
Thanks Tony, I integrated this today and everything seems to be working fine (I 
haven't created a cycle to test it on purpose though :-))

Original comment by etorrebo...@gmail.com on 3 Dec 2012 at 11:02