alan-if / alan

ALAN IF compilers and interpreters
https://alanif.se
Other
18 stars 3 forks source link

Compiler BUG: Silently Fail on Malformed WHERE #44

Closed tajmone closed 2 years ago

tajmone commented 2 years ago

@thoni56, today while experiment with some tests I added the following (wrong) code to an adventure, and it would silently fail to compile:

Syntax makewear = makewear (act) (obj)
  Where act IsA actor
    else "This verb can only be used on actors!"
  And obj IsA object
    else "You can only make actor wear object!"
  And obj is wearable
    else "$+2 is not a wearable item!"

Add to every thing
  Verb makewear
    Does
      Locate obj in act.
      Make obj puesto.
      Set portador of obj to act.
      "Done, now $+1 is wearing $+2."
  End verb.
End add to.

The problem is the line:

  And obj is wearable
    else "$+2 is not a wearable item!"

which should have been a VERB CHECK, not part of the WHERE construct.

But somehow the ALAN compiler is unable to report this error, and simply fails silently, without any message at all.

thoni56 commented 2 years ago

Thanks for reporting this.