-
Notifications
You must be signed in to change notification settings - Fork 110
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
Indented function arguments should be valid syntax #83
Comments
This is preventing me from moving any of my projects to Redux as I rely on a HAML-ish DSL that works perfectly fine in regular coffeescript... Sample: MyView = View.extend
render: (_)->
_ '.aDiv',
_ '.aNestedDiv', 'some text' |
+100 for anything like this that makes line-continuations easier to use, On Sat, Mar 9, 2013 at 11:15 PM, Peter Wong [email protected]:
|
Mine too when I try running my code: {html, css} = require "lilyturf"
page = html ->
@div class: "new",
@span id: "none", "x"
style = css ->
"html":
"css": "red"
head:
fontSize: 10
color: @hsl 10, 20, 30 |
I want this pretty sorely too; there just isn't a way that's tidy to break up arguments across multiple lines in cs-redux. The only ones I have found that are legal are somewhat hideous:
|
+1 Think about a use-case with async: data = [0,1,2,3]
async.eachSeries data,
(elm, cb) ->
# do someting...
cb()
(err) ->
console.log "Done" I have this type of code all over my projects. With the current implementation, I would have to write this code like this: data = [0,1,2,3]
iterator = (elm, cb) ->
# do someting...
cb()
async.eachSeries data, iterator, (err) ->
console.log "Done" which becomes quite hard to maintain once iterator gets longer etc. |
+1 Just tried to migrate a project from the original compiler to redux. I think I'm encountering this issue for code like this:
I get:
As @johan wrote, the only way around it is to skip the indentation altogether on the continuation line, but that lowers readability drastically... |
Correction: My case can be fixed with a backslash to explicitly indicate a continuation line, except on Windows where the CR isn't properly handled by the preprocessor. I'll open a separate issue. |
This coffeescript should be valid.
a b, c d
In regular coffeescript, it generates
But redux says:
The text was updated successfully, but these errors were encountered: