Bug #1037

RDoc 2.2.2 crashes on comments beginning with '##'

Added by Suraj Kurapati about 5 years ago. Updated almost 2 years ago.

[ruby-core:21511]
Status:Closed
Priority:Normal
Assignee:-
Category:lib
Target version:1.9.2
ruby -v:- Backport:

Description

=begin
RDoc 2.2.2 (which is bundled with Ruby 1.9.1-rc2) crashes
when processing comments that begin with two '##' comment
characters. Please observe:

./ruby --version
ruby 1.9.1p0 (2009-01-20 revision 21700) [i686-linux]

rdoc --version
rdoc 2.2.2

cat foo
#!/usr/bin/ruby -w

##
# this is a comment

thisissome_code

./ruby bin/rdoc foo --op foo-out

foo:

RDoc failure in dummy.rb at or around line 7 column
0

Before reporting this, could you check that the file you're documenting
compiles cleanly--RDoc is not a full Ruby parser, and gets confused easily if
fed invalid programs.

The internal error was:

/home/sun/app/ruby19/lib/ruby/1.9.1/rdoc/parser/ruby.rb:2049:in parse_meta_method': undefined methodtoplevel' for # (NoMethodError)
from /home/sun/app/ruby19/lib/ruby/1.9.1/rdoc/parser/ruby.rb:2445:in parse_statements'
from /home/sun/app/ruby19/lib/ruby/1.9.1/rdoc/parser/ruby.rb:2540:in
parse
toplevel_statements'
from /home/sun/app/ruby19/lib/ruby/1.9.1/rdoc/parser/ruby.rb:2706:in `block (2 levels) in scan'

##################################

In contrast, when I do NOT use a double '##' RDoc is OK:

##################################

cat bar
#!/usr/bin/ruby -w

#
# this is a comment

thisissome_code

./ruby bin/rdoc bar --op bar-out

bar:
Generating HTML...

Files: 1
Classes: 0
Modules: 0
Methods: 0
Elapsed: 0.0s

##################################

Thanks for your consideration.
=end

History

#1 Updated by Yuki Sonoda about 5 years ago

  • Target version changed from 1.9.1 RC2 to 1.9.1

=begin

=end

#2 Updated by Suraj Kurapati about 5 years ago

=begin
This bug has been fixed in the RDoc 2.3.0 gem.
=end

#3 Updated by Suraj Kurapati about 5 years ago

=begin
If Ruby 1.9 will use RDoc 2.3.0 instead of RDoc 2.2.2, then this bug can be closed. Thanks.
=end

#4 Updated by Yuki Sonoda about 5 years ago

  • Target version changed from 1.9.1 to 1.9.2
  • ruby -v set to -

=begin

=end

#5 Updated by Yukihiro Matsumoto about 5 years ago

  • Status changed from Open to Closed

=begin

=end

Also available in: Atom PDF