first draft of mandatory parentheses around function definition param lists -- all tests pass

This commit is contained in:
Jeremy Ashkenas
2010-01-26 00:40:58 -05:00
parent 63b44a2b03
commit 460b3f6d8e
57 changed files with 1396 additions and 1561 deletions

View File

@@ -242,19 +242,15 @@ module CoffeeScript
# make use of splats.
def tag_parameters
i = 0
tagged = false
loop do
i -= 1
tok = @tokens[i]
return if !tok
if ['.', ','].include?(tok[0])
tagged = false
next
case tok[0]
when :IDENTIFIER then tok[0] = :PARAM
when ')' then tok[0] = :PARAM_END
when '(' then return tok[0] = :PARAM_START
end
return if tagged
return if tok[0] != :IDENTIFIER
tok[0] = :PARAM
tagged = true
end
end