noolsjs / nools

Rete based rules engine written in javascript
http://noolsjs.com/
MIT License
949 stars 181 forks source link

Compiling rules with custom types #219

Open sdjacobs opened 7 years ago

sdjacobs commented 7 years ago

It seems that I can't create types that have members which are also custom types, when I am compiling with the nools executable. For example, the following code compiles correctly in Javascript with nools.compile(__dirname + "/test.nools"). However, when I run nools compile test.nools I get the error "ReferenceError: Message is not defined".

define Message {
  text: String,
  constructor : function(text) { this.text = text }
}

define Greeting {
  msg: Message,
  constructor : function(msg) { this.msg = msg }
}