mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 11:31:20 -05:00
moving along with whitespace
This commit is contained in:
@@ -3,6 +3,6 @@ results: n * 2 for n in nums.
|
||||
|
||||
# next: for n in [1, 2, 3] if n % 2 isnt 0
|
||||
# print('hi') if false
|
||||
# n * n * 2.
|
||||
# n * n * 2
|
||||
|
||||
print(results.join(',') is '2,18')
|
||||
@@ -1,6 +1,6 @@
|
||||
result: try
|
||||
nonexistent * missing
|
||||
catch error
|
||||
true.
|
||||
true
|
||||
|
||||
print(result)
|
||||
@@ -1,21 +1,21 @@
|
||||
Base: => .
|
||||
Base: =>
|
||||
Base.prototype.func: string =>
|
||||
'zero/' + string.
|
||||
'zero/' + string
|
||||
|
||||
FirstChild: => .
|
||||
FirstChild: =>
|
||||
FirstChild extends Base
|
||||
FirstChild.prototype.func: string =>
|
||||
super('one/') + string.
|
||||
super('one/') + string
|
||||
|
||||
SecondChild: => .
|
||||
SecondChild: =>
|
||||
SecondChild extends FirstChild
|
||||
SecondChild.prototype.func: string =>
|
||||
super('two/') + string.
|
||||
super('two/') + string
|
||||
|
||||
ThirdChild: => .
|
||||
ThirdChild: =>
|
||||
ThirdChild extends SecondChild
|
||||
ThirdChild.prototype.func: string =>
|
||||
super('three/') + string.
|
||||
super('three/') + string
|
||||
|
||||
result: (new ThirdChild()).func('four')
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
identity_wrap: x => => x..
|
||||
identity_wrap: x => => x
|
||||
|
||||
result: identity_wrap(identity_wrap(true))()()
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ func: =>
|
||||
b: []
|
||||
while a >= 0
|
||||
b.push('o')
|
||||
a--.
|
||||
a--
|
||||
|
||||
c: {
|
||||
"text": b
|
||||
@@ -14,14 +14,14 @@ func: =>
|
||||
c.text: if false
|
||||
'error'
|
||||
else
|
||||
c.text + '---'.
|
||||
c.text + '---'
|
||||
|
||||
d = {
|
||||
text = c.text
|
||||
}
|
||||
|
||||
c.list: l for l in d.text.split('') if l is '-'.
|
||||
c.list: l for l in d.text.split('') if l is '-'
|
||||
|
||||
c.single: c.list[1..1][0].
|
||||
c.single: c.list[1..1][0]
|
||||
|
||||
print(func() == '-')
|
||||
|
||||
@@ -3,9 +3,8 @@ c: false
|
||||
|
||||
result: if a
|
||||
if b
|
||||
if c then false
|
||||
else
|
||||
if c then false else
|
||||
if d
|
||||
true....
|
||||
true
|
||||
|
||||
print(result)
|
||||
@@ -1,6 +1,6 @@
|
||||
six: \
|
||||
1 + \
|
||||
2 + \
|
||||
3
|
||||
1 + \
|
||||
2 + \
|
||||
3
|
||||
|
||||
print(six is 6)
|
||||
14
test/fixtures/execution/test_switch.coffee
vendored
14
test/fixtures/execution/test_switch.coffee
vendored
@@ -1,11 +1,13 @@
|
||||
num: 10
|
||||
|
||||
result: switch num
|
||||
when 5 then false
|
||||
when 'a'
|
||||
false
|
||||
when 10 then true
|
||||
when 11 then false
|
||||
else false.
|
||||
when 5 then false
|
||||
when 'a'
|
||||
true
|
||||
true
|
||||
false
|
||||
when 10 then true
|
||||
when 11 then false
|
||||
else false
|
||||
|
||||
print(result)
|
||||
|
||||
Reference in New Issue
Block a user