1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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:
dave 2003-12-24 15:44:41 +00:00
parent 65d37c6cc5
commit 060f19e92c

View file

@ -611,20 +611,17 @@ class RubyLex
str = op
@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"
gets
begin
line = ""
begin
ch = getc
line << ch
end until ch == "\n"
str << line
end until line =~ /^=end/
ungetc
@ltype = nil
Token(TkRD_COMMENT).set_text(str)