mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 11:31:20 -05:00
outdent lexing is correct now, I think
This commit is contained in:
@@ -122,6 +122,7 @@ module CoffeeScript
|
|||||||
@i += comment.length
|
@i += comment.length
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Record tokens for indentation differing from the previous line.
|
||||||
def indent_token
|
def indent_token
|
||||||
return false unless indent = @chunk[INDENT, 1]
|
return false unless indent = @chunk[INDENT, 1]
|
||||||
size = indent.size
|
size = indent.size
|
||||||
@@ -132,8 +133,8 @@ module CoffeeScript
|
|||||||
@indents << @indent
|
@indents << @indent
|
||||||
else
|
else
|
||||||
tag = :OUTDENT
|
tag = :OUTDENT
|
||||||
@indents.pop
|
@indents.pop while @indents.last && ((@indents.last || 0) > size)
|
||||||
@indent = @indents.first || 0
|
@indent = @indents.last || 0
|
||||||
end
|
end
|
||||||
@i += (size + 1)
|
@i += (size + 1)
|
||||||
token(tag, size)
|
token(tag, size)
|
||||||
|
|||||||
Reference in New Issue
Block a user