Undeclared variables in generated code
After updating Spoofax, NaBL suddenly generates erroneous code (undeclared variables) for the following rule:
AssocClass(ss, name, RelRef(SSRef(ss2), r), _): defines non-unique AssocClassPartialDef RelRef(SSRef(ss2), r)
Note 1: It used to work in the nightly build of around two weeks ago.
Submitted by Oskar van Rest on 22 January 2014 at 08:17
Note 2: It works if you replace both occurrences ofRelRef(SSRef(ss2), r)
byrelRef
, but I need the subterms to define some use sites (which are left out from the code above).
Issue Log
Just found out it’s now possible to use the
@
symbol in NaBL:AssocClass(ss, name, ref@RelRef(SSRef(ss2), r), _): defines non-unique AssocClassPartialDef ref
This solves the issue.
Possibly NaBL should show an error for the piece of code it cannot handle?
Can you show the erroneous generated code and the errors it produced?
nabl-def-site(child-uris__, sibl-uris__, implicits__|lang__, partition__, uniques__, uri__, states__) = ?AssocClass( ss , name , RelRef(SSRef(ss2), r) , _ ) ; origin-track-forced( AssocClass( id , id , origin-track-forced( RelRef(origin-track-forced(SSRef(id)|), id) | ) , id ) | ) ; match(child-uris__|c-uri1__) ; match(sibl-uris__|s-uri1__) ; match(implicits__|[])
Errors:
Variable 'c-uri1__' is not declared
Variable 's-uri1__' is not declared
Something goes wrong in the replacement. I will check this in the generator.
This was fixed in the generator.
Log in to post comments