part of the way to supporting multiline array comprehensions -- the grammar and parsing is there -- the code generation is tricky

This commit is contained in:
Jeremy Ashkenas
2009-12-27 21:50:02 -08:00
parent ac00a19514
commit aa45456d7d
3 changed files with 13 additions and 5 deletions

View File

@@ -571,6 +571,8 @@ module CoffeeScript
if o[:return] || o[:assign]
return_result = "#{o[:assign].compile(o)} = #{return_result}" if o[:assign]
return_result = "return #{return_result}" if o[:return]
o.delete(:assign)
o.delete(:return)
if @filter
body = CallNode.new(ValueNode.new(LiteralNode.new(rvar), [AccessorNode.new('push')]), [@body])
body = IfNode.new(@filter, body, nil, :statement => true)