outdent lexing is correct now, I think

This commit is contained in:
Jeremy Ashkenas
2009-12-24 14:51:53 -08:00
parent da84906d1e
commit 73a0777705

View File

@@ -122,6 +122,7 @@ module CoffeeScript
@i += comment.length
end
# Record tokens for indentation differing from the previous line.
def indent_token
return false unless indent = @chunk[INDENT, 1]
size = indent.size
@@ -132,8 +133,8 @@ module CoffeeScript
@indents << @indent
else
tag = :OUTDENT
@indents.pop
@indent = @indents.first || 0
@indents.pop while @indents.last && ((@indents.last || 0) > size)
@indent = @indents.last || 0
end
@i += (size + 1)
token(tag, size)