2010-07-10 08:44:30 -04:00
|
|
|
# comment before a ...
|
|
|
|
|
|
|
|
###
|
|
|
|
... block comment.
|
|
|
|
###
|
|
|
|
|
|
|
|
|
2010-01-05 23:15:32 -05:00
|
|
|
# comment
|
2010-07-25 01:23:37 -04:00
|
|
|
func = ->
|
2010-01-05 23:15:32 -05:00
|
|
|
# comment
|
2009-12-30 22:24:40 -05:00
|
|
|
false
|
|
|
|
false # comment
|
|
|
|
false
|
2010-04-21 22:26:45 -04:00
|
|
|
|
2009-12-30 22:24:40 -05:00
|
|
|
# comment
|
|
|
|
true
|
2010-01-05 23:15:32 -05:00
|
|
|
|
2010-01-10 17:36:06 -05:00
|
|
|
switch 'string'
|
|
|
|
# comment
|
|
|
|
when false then something()
|
|
|
|
# comment
|
|
|
|
when null
|
2010-06-12 19:05:13 -04:00
|
|
|
somethingElse()
|
2010-01-10 17:36:06 -05:00
|
|
|
|
2010-01-26 10:52:05 -05:00
|
|
|
->
|
2010-01-20 20:36:31 -05:00
|
|
|
code()
|
|
|
|
# comment
|
|
|
|
|
2010-02-16 19:45:25 -05:00
|
|
|
ok func()
|
2010-02-16 10:12:40 -05:00
|
|
|
|
|
|
|
func
|
|
|
|
func
|
|
|
|
# Line3
|
2010-03-02 19:23:21 -05:00
|
|
|
|
2010-07-25 01:23:37 -04:00
|
|
|
obj = {
|
2010-03-02 19:23:21 -05:00
|
|
|
# comment
|
|
|
|
# comment
|
|
|
|
# comment
|
|
|
|
one: 1
|
|
|
|
# comment
|
|
|
|
two: 2
|
|
|
|
# comment
|
|
|
|
}
|
2010-03-10 16:44:50 -05:00
|
|
|
|
2010-07-25 01:23:37 -04:00
|
|
|
result = if true # comment
|
2010-03-10 16:44:50 -05:00
|
|
|
false
|
|
|
|
|
|
|
|
ok not result
|
|
|
|
|
2010-07-25 01:23:37 -04:00
|
|
|
result = if false
|
2010-03-10 16:44:50 -05:00
|
|
|
false
|
|
|
|
else # comment
|
|
|
|
45
|
|
|
|
|
|
|
|
ok result is 45
|
2010-03-20 00:58:25 -04:00
|
|
|
|
|
|
|
|
2010-07-25 01:23:37 -04:00
|
|
|
test =
|
2010-03-20 00:58:25 -04:00
|
|
|
'test ' +
|
|
|
|
'test ' + # comment
|
|
|
|
'test'
|
|
|
|
|
|
|
|
ok test is 'test test test'
|
2010-05-12 20:56:44 -04:00
|
|
|
|
|
|
|
###
|
|
|
|
This is a here-comment.
|
|
|
|
Kind of like a heredoc.
|
|
|
|
###
|
2010-06-02 00:03:07 -04:00
|
|
|
|
2010-09-21 22:59:28 -04:00
|
|
|
func = ->
|
|
|
|
###
|
|
|
|
Another block comment.
|
|
|
|
###
|
|
|
|
code
|
2010-06-12 17:41:46 -04:00
|
|
|
|
2010-07-25 01:23:37 -04:00
|
|
|
func = ->
|
|
|
|
one = ->
|
|
|
|
two = ->
|
|
|
|
three = ->
|
2010-07-06 22:20:42 -04:00
|
|
|
###
|
|
|
|
block.
|
|
|
|
###
|
2010-07-25 01:23:37 -04:00
|
|
|
four = ->
|
2010-07-06 22:20:42 -04:00
|
|
|
|
2010-07-25 01:23:37 -04:00
|
|
|
fn1 = ->
|
|
|
|
oneLevel = null
|
2010-07-06 22:20:42 -04:00
|
|
|
###
|
|
|
|
This isn't fine.
|
|
|
|
###
|
|
|
|
|
|
|
|
ok ok
|
|
|
|
|
2010-07-25 01:23:37 -04:00
|
|
|
obj = {
|
2010-07-01 21:51:28 -04:00
|
|
|
a: 'b'
|
2010-07-01 21:26:33 -04:00
|
|
|
###
|
|
|
|
comment
|
|
|
|
###
|
2010-07-01 21:51:28 -04:00
|
|
|
c: 'd'
|
2010-07-01 21:26:33 -04:00
|
|
|
}
|
|
|
|
|
2010-06-12 17:41:46 -04:00
|
|
|
# Spaced comments in if / elses.
|
2010-07-25 01:23:37 -04:00
|
|
|
result = if false
|
2010-06-12 17:41:46 -04:00
|
|
|
1
|
|
|
|
|
|
|
|
# comment
|
|
|
|
else if false
|
|
|
|
2
|
|
|
|
|
|
|
|
# comment
|
|
|
|
else
|
|
|
|
3
|
|
|
|
|
|
|
|
ok result is 3
|
2010-06-12 18:06:33 -04:00
|
|
|
|
|
|
|
|
2010-07-25 01:23:37 -04:00
|
|
|
result = switch 'z'
|
2010-06-12 18:06:33 -04:00
|
|
|
when 'z' then 7
|
|
|
|
# comment
|
|
|
|
ok result is 7
|
2010-06-27 13:02:47 -04:00
|
|
|
|
|
|
|
|
|
|
|
# Trailing-line comment before an outdent.
|
2010-07-25 01:23:37 -04:00
|
|
|
func = ->
|
2010-06-27 13:02:47 -04:00
|
|
|
if true
|
|
|
|
true # comment
|
|
|
|
7
|
|
|
|
|
|
|
|
ok func() is 7
|
2010-07-15 08:50:49 -04:00
|
|
|
|
|
|
|
|
|
|
|
# Trailing herecomment in a function.
|
2010-07-25 01:23:37 -04:00
|
|
|
fn = ->
|
2010-07-15 08:50:49 -04:00
|
|
|
code
|
|
|
|
###
|
|
|
|
debug code commented
|
|
|
|
###
|
|
|
|
|
2010-07-25 01:23:37 -04:00
|
|
|
fn2 = ->
|
2010-08-10 23:06:06 -04:00
|
|
|
|
|
|
|
|
|
|
|
class A
|
|
|
|
b: ->
|
|
|
|
|
|
|
|
###
|
|
|
|
Comment
|
|
|
|
###
|
|
|
|
c: ->
|
|
|
|
|
2010-09-21 23:13:46 -04:00
|
|
|
ok A.prototype.c instanceof Function
|
|
|
|
|
|
|
|
class A
|
|
|
|
###
|
|
|
|
Comment
|
|
|
|
###
|
|
|
|
b: ->
|
|
|
|
c: ->
|
|
|
|
|
|
|
|
ok A.prototype.b instanceof Function
|