зеркало из https://github.com/github/ruby.git
Fix bug where two adjacent =begin/=end blocks causes the parser to get out of step.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
65d37c6cc5
Коммит
060f19e92c
|
@ -611,20 +611,17 @@ class RubyLex
|
||||||
str = op
|
str = op
|
||||||
@ltype = "="
|
@ltype = "="
|
||||||
|
|
||||||
begin
|
|
||||||
ch = getc
|
|
||||||
str << ch
|
|
||||||
end until ch == "\n"
|
|
||||||
|
|
||||||
until peek_equal?("=end") && peek(4) =~ /\s/
|
|
||||||
begin
|
|
||||||
ch = getc
|
|
||||||
str << ch
|
|
||||||
end until ch == "\n"
|
|
||||||
end
|
|
||||||
|
|
||||||
str << "=end"
|
begin
|
||||||
gets
|
line = ""
|
||||||
|
begin
|
||||||
|
ch = getc
|
||||||
|
line << ch
|
||||||
|
end until ch == "\n"
|
||||||
|
str << line
|
||||||
|
end until line =~ /^=end/
|
||||||
|
|
||||||
|
ungetc
|
||||||
|
|
||||||
@ltype = nil
|
@ltype = nil
|
||||||
Token(TkRD_COMMENT).set_text(str)
|
Token(TkRD_COMMENT).set_text(str)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче