machty / emblem.js

Emblem.js - Ember-friendly, indented syntax alternative for Handlebars.js
http://emblemjs.com
MIT License
1.04k stars 81 forks source link

Emblem fails with multiple subexpressions #267

Closed SaladFork closed 8 years ago

SaladFork commented 8 years ago

This is especially noticeable when using something like ember-truth-helpers. Using if, and, and or helpers and true values to demonstrate:

/ works
if true | foo

if (and true true) | foo

if (and true (or true true)) | foo
if (and (or true true) true) | foo

/ doesn't work (Expected _4BeginStatement or end of input)
if (and (or true true) (or true true)) | foo

(This is not an issue with and/or as the same issue occurs with any other helper)

The same issue occurs when passing nested subexpressions as values:

/ works
my-checkbox checked=(and (or true true) true)

/ doesn't work
my-checkbox checked=(and (or true true) (or true true))

Equivalent handlebars:

{{#if (and (or true true) (or true true))}}
  foo
{{/if}}

{{my-checkbox checked=(and (or true true) (or true true))}}
thec0keman commented 8 years ago

Fixed #267