big milestone. examples/code.coffee now compiles correctly under the new whitespace regime
This commit is contained in:
parent
e6cd32f2fc
commit
cd68f02981
|
@ -150,7 +150,7 @@ Snake.prototype.move: =>
|
||||||
alert('Slithering...')
|
alert('Slithering...')
|
||||||
super(5)
|
super(5)
|
||||||
|
|
||||||
Horse: name => this.name: name.
|
Horse: name => this.name: name
|
||||||
Horse extends Animal
|
Horse extends Animal
|
||||||
Horse.prototype.move: =>
|
Horse.prototype.move: =>
|
||||||
alert('Galloping...')
|
alert('Galloping...')
|
||||||
|
|
|
@ -353,7 +353,7 @@ rule
|
||||||
|
|
||||||
# An elsif portion of an if-else block.
|
# An elsif portion of an if-else block.
|
||||||
ElsIf:
|
ElsIf:
|
||||||
ELSE IfBlock { result = val[1] }
|
ELSE IfBlock { result = val[1].force_statement }
|
||||||
;
|
;
|
||||||
|
|
||||||
# Multiple elsifs can be chained together.
|
# Multiple elsifs can be chained together.
|
||||||
|
|
|
@ -685,6 +685,11 @@ module CoffeeScript
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def force_statement
|
||||||
|
@tags[:statement] = true
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
# Rewrite a chain of IfNodes with their switch condition for equality.
|
# Rewrite a chain of IfNodes with their switch condition for equality.
|
||||||
def rewrite_condition(expression)
|
def rewrite_condition(expression)
|
||||||
@condition = OpNode.new("is", expression, @condition)
|
@condition = OpNode.new("is", expression, @condition)
|
||||||
|
|
Loading…
Reference in New Issue