mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 11:31:20 -05:00
first draft of mandatory parentheses around function definition param lists -- all tests pass
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user