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:
parent
65d37c6cc5
commit
060f19e92c
1 changed files with 10 additions and 13 deletions
|
@ -611,20 +611,17 @@ class RubyLex
|
||||||
str = op
|
str = op
|
||||||
@ltype = "="
|
@ltype = "="
|
||||||
|
|
||||||
|
|
||||||
|
begin
|
||||||
|
line = ""
|
||||||
begin
|
begin
|
||||||
ch = getc
|
ch = getc
|
||||||
str << ch
|
line << ch
|
||||||
end until ch == "\n"
|
end until ch == "\n"
|
||||||
|
str << line
|
||||||
|
end until line =~ /^=end/
|
||||||
|
|
||||||
until peek_equal?("=end") && peek(4) =~ /\s/
|
ungetc
|
||||||
begin
|
|
||||||
ch = getc
|
|
||||||
str << ch
|
|
||||||
end until ch == "\n"
|
|
||||||
end
|
|
||||||
|
|
||||||
str << "=end"
|
|
||||||
gets
|
|
||||||
|
|
||||||
@ltype = nil
|
@ltype = nil
|
||||||
Token(TkRD_COMMENT).set_text(str)
|
Token(TkRD_COMMENT).set_text(str)
|
||||||
|
|
Loading…
Reference in a new issue