Created
June 15, 2012 22:27
-
-
Save aseemk/2939002 to your computer and use it in GitHub Desktop.
CoffeeScript's interesting line continuation behavior
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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