Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing issue with nested objects that use function return values as their value #78

Closed
nfm opened this issue Nov 28, 2012 · 1 comment

Comments

@nfm
Copy link
Collaborator

nfm commented Nov 28, 2012

I'm hitting a parsing error (ExecJS::RuntimeError: SyntaxError: unmatched OUTDENT on line X) with templates like the following:

%input{ value: someFunction('literal', someOption: otherFunction(1)) }

The following cases all seem to fail as well:

%input{ value: someFunction('literal', { someOption: otherFunction(1) }) }
%input{ value: someFunction('literal', { someOption: otherFunction(1) }) }
%input{ value: someFunction('literal', 'someOption': otherFunction(1)) }
%input{ value: someFunction('literal', { 'someOption': otherFunction(1) }) }
%input{ value: (someFunction('literal', someOption: otherFunction(1))) }
%input{ value: (someFunction('literal', { someOption: otherFunction(1) })) }
%input{ value: (someFunction('literal', 'someOption': otherFunction(1))) }
%input{ value: (someFunction('literal', { 'someOption': otherFunction(1) })) }

Regular evaluation works fine, outside the context of an %input{ value: }:

= someFunction('literal', someOption: otherFunction(1))

As do hard-coded values in the nested object:

= %input{ value: someFunction('literal', someOption: 'optionValue') }

Not sure if that's clear or not, it's a bit confusing.

Best regards,
Nicholas

@netzpirat
Copy link
Collaborator

The problem was that the nested parenthesis in the function call was not detected. This is fixed in both Haml Coffee and Haml Coffee Assets 1.8.2. Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants