Bug #7944
closed1.9.3 can't process and generate documentation for 2.0.0 (lib/profiler.rb)
Description
=begin
While working on RubyInstaller, we try to generate RDoc of Ruby source.
Using RDoc 3.12.1, we received the following:
Parsing sources...
18% [125/663] lib/profiler.rb
RDoc::Parser::Ruby failure around line 79 of
lib/profiler.rb
Before reporting this, could you check that the file you're documenting
has proper syntax:
C:/Users/Luis/Tools/Ruby/ruby-1.9.3-p385-i386-mingw32/bin/ruby.exe -c lib/profiler.rb
RDoc is not a full Ruby parser and will fail when fed invalid ruby programs.
The internal error was:
(RDoc::RubyLex::Error) unknown type of %string "i"
rake aborted!
unknown type of %string "i"
When executed ruby with (({-c})) received the following:
C:\Users\Luis\Code\oneclick\rubyinstaller>ruby -v -c sandbox\ruby_1_9\lib\profiler.rb
ruby 1.9.3p385 (2013-02-06) [i386-mingw32]
sandbox/ruby_1_9/lib/profiler.rb:79: unknown type of %string
...CALL_PROC = TracePoint.new(%i[call c_call b_call]) {|tp| # ...
... ^
sandbox/ruby_1_9/lib/profiler.rb:79: syntax error, unexpected $end
...CALL_PROC = TracePoint.new(%i[call c_call b_call]) {|tp| # ...
... ^
The syntax is OK for 2.0.0:
C:\Users\Luis\Code\oneclick\rubyinstaller>sandbox\ruby19_mingw\bin\ruby -v -c sandbox\ruby_1_9\lib\profiler.rb
ruby 2.0.0p0 (2013-02-24) [i386-mingw32]
Syntax OK
We can't use Ruby's 2.0 RDoc version as we need rdoc_chm gem and we are building a clean installer.
I would like to know if is possible change (({lib/profiler.rb})) to use an array of symbols instead.
Thank you
=end