fixin up narwhal factory and adding more implicit blocks to the lexer

This commit is contained in:
Jeremy Ashkenas
2009-12-30 14:32:59 -05:00
parent ea58be2838
commit f93e552cb3
7 changed files with 35 additions and 46 deletions

View File

@@ -693,8 +693,8 @@ module CoffeeScript
end
# Rewrite a chain of IfNodes to add a default case as the final else.
def add_else(expressions)
chain? ? @else_body.add_else(expressions) : @else_body = expressions.unwrap
def add_else(exprs)
chain? ? @else_body.add_else(exprs) : @else_body = (exprs && exprs.unwrap)
self
end