hylyh / bondage.js

Javascript-based parser for the Yarn dialogue tree markup language
https://www.npmjs.com/package/bondage
MIT License
57 stars 21 forks source link

Shortcut option requiring a nested line #53

Open mrjackphil opened 4 years ago

mrjackphil commented 4 years ago

The second example code from YarnSpinner doesn't work without nesting the last sentence.

Example from the link (will not work in bondage)

Bob: What would you like?
-> A burger. <<if $money >= 5>>
    Bob: Nice. Enjoy!
-> A soda. <<if $money >= 2>>
    Bob: Yum!
-> Nothing.
Bob: Thanks for coming!

If we will nest the last sentence it will work

Bob: What would you like?
-> A burger. <<if $money >= 5>>
    Bob: Nice. Enjoy!
-> A soda. <<if $money >= 2>>
    Bob: Yum!
-> Nothing.
    Bob: Thanks for coming!