-
Notifications
You must be signed in to change notification settings - Fork 111
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
newlines in function arguments or parenthesis enclosed blocks #325
Comments
Your code looks bad for me too. Anyway, if I modify your code just for a bit: angular.module('App').controller('AppController', [
'$location', '$scope', (
$location, $scope) ->
@link = (field) ->
("http://example.com" +
"/" + field)
@
]) CoffeeScriptRedux compiles it as expected: // Generated by CoffeeScript 2.0.0-beta8
angular.module('App').controller('AppController', [
'$location',
'$scope',
function ($location, $scope) {
this.link = function (field) {
return 'http://example.com' + '/' + field;
};
return this;
}
]); |
indeed, but if it's valid for the original coffee compiler, shouldn't your compiler like it too? |
@arkarkark Honestly, I can't understand why vanilla coffee-script acts so "forgiving". |
:-D |
OK, so why is this invalid? a(b,
c)
→ Syntax error on line 1, column 5: unexpected '\n' (\u000A) isn’t the grouping given via parens? it’s especially of interest for me because coffee-react-transform creates such code: Car = React.createClass
render: ->
React.createElement(Vehicle, {"doors": (4), "locked": (isLocked()), "data-colour": "red", "on": true},
React.createElement(Parts.FrontSeat, null),
React.createElement(Parts.BackSeat, null),
React.createElement("p", {"className": "seat"}, "Which seat can I take? ", (@props?.seat or 'none'))
) |
a(b
,c)
# or
a \
b
, c |
thanks but:
|
the following code (bad.coffee) is parsed by the original coffee but not CoffeeScriptRedux
if I modify it to this (good.coffee) it works
I can't tell if this is #119 or #142 related so apologies if it's a dupe.
I installed from npm
and the original CoffeeScript
The text was updated successfully, but these errors were encountered: