aichaos / rivescript-go

A RiveScript interpreter for Go. RiveScript is a scripting language for chatterbots.
https://www.rivescript.com/
MIT License
60 stars 16 forks source link

Macros within conditionals #37

Closed meowgorithm closed 6 years ago

meowgorithm commented 6 years ago

Should macros execute and return before a conditional is evaluated? Currently, in a case such as this…

+ my name is *
* <call>isHisNameFrank <star></call> == true => Welcome, Frank.
- You’re not Frank. Go find Frank.

…it appears that the macro not being called at all.

An issue in the JavaScript RiveScript project makes me think the expected behavior is that macros should indeed execute before the conditional is evaluated.

kirsle commented 6 years ago

Yeah they should work. Try turning on debug mode and see what it's doing when it evaluates the conditionals. There might be a bug in what it's doing with the tag that makes the condition not match correctly.

On Oct 11, 2017 6:45 PM, "Christian Rocha" notifications@github.com wrote:

Should macros execute and return before a conditional is evaluated? Currently, in a case such as this…

…it appears that the macro not being called at all.

An issue in the JavaScript RiveScript project https://github.com/aichaos/rivescript-js/pull/111 makes me think the expected behavior is that macros should indeed execute before the conditional is evaluated.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/aichaos/rivescript-go/issues/37, or mute the thread https://github.com/notifications/unsubscribe-auth/ABliEzkdaA5IROk_JAXeXgw4jPsjVdcWks5srW8hgaJpZM4P2WsD .

meowgorithm commented 6 years ago

Gah, my mistake indeed. Verified that this works as intended.