michaelficarra / CoffeeScriptRedux

:sweat: rewrite of the CoffeeScript compiler with proper compiler design principles and a focus on robustness and extensibility
https://michaelficarra.github.com/CoffeeScriptRedux/
BSD 3-Clause "New" or "Revised" License
1.84k stars 110 forks source link

Unintentional difference in promise-style indentation #326

Open rstacruz opened 10 years ago

rstacruz commented 10 years ago

Placing .then in a.then(b) in the same indent level of a produces different results in jashkenas/coffee-script vs redux.

$.get('/notifications')
.then ->
  $.post('/notifications/read')
.then (result) ->
  alert result

jashkenas/coffee-script:

$.get('/users').then(function(data) {
  return $.post('/users', data);
}).then(function(result) {
  return alert(result);
});

Redux:

Syntax error on line 4, column 0: unexpected '.' (\u002E)
1 : $.get('/users')
2 : .then (data) ->
3 : $.post('/users', data)
4 : .then (result) ->
^ :~^
5 : alert(result)

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/4031307-unintentional-difference-in-promise-style-indentation?utm_campaign=plugin&utm_content=tracker%2F33145&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F33145&utm_medium=issues&utm_source=github).
eddiemonge commented 10 years ago

I get this as well

19h commented 10 years ago

Redux doesn't allow variable indentation anymore. Check if you're using space & tabs combined by accident.

lordnox commented 8 years ago

I do have this problem as well (see: https://github.com/michaelficarra/CoffeeScriptRedux/issues/22)

I did make sure to just have 2-spaces for indentation