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.
Note 2: It works if you replace both occurrences of RelRef(SSRef(ss2), r) by relRef, but I need the subterms to define some use sites (which are left out from the code above).

Submitted by Oskar van Rest on 22 January 2014 at 08:17

On 22 January 2014 at 08:20 Oskar van Rest commented:

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.


On 22 January 2014 at 08:25 Oskar van Rest commented:

Possibly NaBL should show an error for the piece of code it cannot handle?


On 22 January 2014 at 12:49 Gabriël Konat commented:

Can you show the erroneous generated code and the errors it produced?


On 22 January 2014 at 12:55 Oskar van Rest commented:
  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


On 22 January 2014 at 13:23 Guido Wachsmuth commented:

Something goes wrong in the replacement. I will check this in the generator.


On 22 January 2014 at 13:28 Oskar van Rest commented:

On 20 May 2014 at 23:57 Guido Wachsmuth commented:

This was fixed in the generator.


On 20 May 2014 at 23:57 Guido Wachsmuth closed this issue.

Log in to post comments