summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/compiler.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2014-10-27 00:23:32 -0500
committerkpdecker <kpdecker@gmail.com>2014-10-27 19:17:16 -0500
commit4282668d47b90da0d00cf4c4a86977f18fc8cde4 (patch)
treea7254e549e27afb8043b03dd6ddd21e3afaae2e6 /lib/handlebars/compiler/compiler.js
parent8aa2a34a8d2453a45a3bc9d45e1fbed17e4d8bbc (diff)
downloadhandlebars.js-4282668d47b90da0d00cf4c4a86977f18fc8cde4.zip
handlebars.js-4282668d47b90da0d00cf4c4a86977f18fc8cde4.tar.gz
handlebars.js-4282668d47b90da0d00cf4c4a86977f18fc8cde4.tar.bz2
Implement parser for else chaining of helpers
Allows users to chain multiple helpers together using their inverse callbacks. I.e. ``` {{#if foo}} {{else if bar}} {{else}} {{/if}} ``` The control flow here effectively causes the helpers to be nested. The above is actually syntactic sugar for this: ``` {{#if foo}} {{else}} {{#if bar}} {{else}} {{/if}} {{/if}} ``` Any helper may be used in this manner, the only requirement is they support normal calls and inverse calls. Introduces a breaking change in that `{{else foo}}` may no longer be used as a root level operator. Instead `{{^foo}}` must be used. Fixes #72.
Diffstat (limited to 'lib/handlebars/compiler/compiler.js')
0 files changed, 0 insertions, 0 deletions