diff options
| author | dave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-24 15:44:41 +0000 |
|---|---|---|
| committer | dave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-24 15:44:41 +0000 |
| commit | 25e1b6a9be289226c80635fa1cc631d55623a29b (patch) | |
| tree | 89e6c21f419725bac3fd10ef611c6775ce79ca8d /lib/rdoc | |
| parent | 47ccaefee41d6cf2d549d9c4226741529fdb5b85 (diff) | |
| download | ruby-25e1b6a9be289226c80635fa1cc631d55623a29b.tar.gz ruby-25e1b6a9be289226c80635fa1cc631d55623a29b.tar.xz ruby-25e1b6a9be289226c80635fa1cc631d55623a29b.zip | |
Fix bug where two adjacent =begin/=end blocks causes the parser to get out of step.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc')
| -rw-r--r-- | lib/rdoc/parsers/parse_rb.rb | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/rdoc/parsers/parse_rb.rb b/lib/rdoc/parsers/parse_rb.rb index a0e4044b6..08d906c00 100644 --- a/lib/rdoc/parsers/parse_rb.rb +++ b/lib/rdoc/parsers/parse_rb.rb @@ -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 + line = "" + begin ch = getc - str << ch + line << ch end until ch == "\n" - end + str << line + end until line =~ /^=end/ - str << "=end" - gets + ungetc @ltype = nil Token(TkRD_COMMENT).set_text(str) |
