Skip to content

Instantly share code, notes, and snippets.

@aseemk
Created June 15, 2012 22:27
Show Gist options
  • Save aseemk/2939002 to your computer and use it in GitHub Desktop.
Save aseemk/2939002 to your computer and use it in GitHub Desktop.
CoffeeScript's interesting line continuation behavior
# all on one long line works:
if not foo or not bar or not baz = Some.reallyLongMethodName foo, bar, _
error = true
# newline with matched three-space indentation level works:
if not foo or not bar or
not baz = Some.reallyLongMethodName foo, bar, _
error = true
# but newline with one regular indentation level *doesn't* work:
if not foo or not bar or
not baz = Some.reallyLongMethodName foo, bar, _
error = true
# interestingly, even using parentheses doesn't work:
if (not foo or not bar or
not baz = Some.reallyLongMethodName foo, bar, _)
error = true
# but newline with *two* regular indentation levels *does* work:
if not foo or not bar or
not baz = Some.reallyLongMethodName foo, bar, _
error = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment