зеркало из https://github.com/github/ruby.git
Number sign comment (# bla bla) is a kind of newline character
This commit is contained in:
Родитель
bc0da8e3ff
Коммит
49b4507fd3
|
@ -332,7 +332,7 @@ class RubyLex
|
||||||
depth_difference = 0
|
depth_difference = 0
|
||||||
@tokens.each_with_index do |t, index|
|
@tokens.each_with_index do |t, index|
|
||||||
case t[1]
|
case t[1]
|
||||||
when :on_ignored_nl, :on_nl
|
when :on_ignored_nl, :on_nl, :on_comment
|
||||||
if index != (@tokens.size - 1)
|
if index != (@tokens.size - 1)
|
||||||
depth_difference = 0
|
depth_difference = 0
|
||||||
end
|
end
|
||||||
|
@ -381,7 +381,7 @@ class RubyLex
|
||||||
@tokens.each_with_index do |t, index|
|
@tokens.each_with_index do |t, index|
|
||||||
corresponding_token_depth = nil
|
corresponding_token_depth = nil
|
||||||
case t[1]
|
case t[1]
|
||||||
when :on_ignored_nl, :on_nl
|
when :on_ignored_nl, :on_nl, :on_comment
|
||||||
spaces_at_line_head = 0
|
spaces_at_line_head = 0
|
||||||
is_first_spaces_of_line = true
|
is_first_spaces_of_line = true
|
||||||
is_first_printable_of_line = true
|
is_first_printable_of_line = true
|
||||||
|
|
Загрузка…
Ссылка в новой задаче