first draft of kamatsu's rewrite rules -- finally got whitespace to be flexible enough, I think.

This commit is contained in:
Jeremy Ashkenas
2009-12-28 21:07:47 -05:00
parent 50bdd2668c
commit ddd52a1845

View File

@@ -268,7 +268,15 @@ module CoffeeScript
def rewrite_closing_parens
stack = []
scan_tokens do |prev, token, post, i|
stack.push(token) if [:INDENT, '('].include?(token[0])
if [:OUTDENT, ')'].include?(token[0])
reciprocal = stack.pop
if reciprocal[0] == :INDENT
@tokens[i] = [:OUTDENT, Value.new(reciprocal[1], token[1].line)]
else
@tokens[i] = [')', Value.new(')', token[1].line)]
end
end
end
end