adding splats as arguments to function calls

This commit is contained in:
Jeremy Ashkenas
2009-12-31 19:52:13 -05:00
parent abfc9f5a2d
commit 409283a30f
5 changed files with 90 additions and 27 deletions

View File

@@ -196,17 +196,11 @@ module CoffeeScript
i = 0
loop do
i -= 1
tok, prev = @tokens[i], @tokens[i - 1]
tok = @tokens[i]
return if !tok
next if tok[0] == ','
next if ['*', ','].include?(tok[0])
return if tok[0] != :IDENTIFIER
if prev && prev[0] == '*'
tok[0] = :SPLAT
@tokens.delete_at(i - 1)
i -= 1
else
tok[0] = :PARAM
end
tok[0] = :PARAM
end
end