Bug in flog?

Minimal case : bug appears when adding this two lines
=begin
=end
at the end of a file, and disappears when taking them out.

from <internal:lib/rubygems/custom_require>:29:in `require'

F:/Ruby191/lib/ruby/gems/1.9.1/gems/ruby_parser-2.0.5/lib/ruby_lexer.rb:739:in
block in yylex': you shouldn't be able to get here (RuntimeError) from F:/Ruby191/lib/ruby/gems/1.9.1/gems/ruby_parser-2.0.5/lib/ruby_lexer.rb:649:inloop’
from
F:/Ruby191/lib/ruby/gems/1.9.1/gems/ruby_parser-2.0.5/lib/ruby_lexer.rb:649:in
yylex' from F:/Ruby191/lib/ruby/gems/1.9.1/gems/ruby_parser-2.0.5/lib/ruby_lexer.rb:68:inadvance’
from
F:/Ruby191/lib/ruby/gems/1.9.1/gems/ruby_parser-2.0.5/lib/ruby_parser_extras.rb:712:in
next_token' from F:/Ruby192/lib/ruby/1.9.1/racc/parser.rb:99:in_racc_do_parse_c’
from F:/Ruby192/lib/ruby/1.9.1/racc/parser.rb:99:in do_parse' from F:/Ruby191/lib/ruby/gems/1.9.1/gems/ruby_parser-2.0.5/lib/ruby_parser_extras.rb:749:inprocess’
from
F:/Ruby191/lib/ruby/gems/1.9.1/gems/flog-2.5.0/lib/flog.rb:241:in block in flog' from F:/Ruby191/lib/ruby/gems/1.9.1/gems/flog-2.5.0/lib/flog.rb:235:ineach’
from
F:/Ruby191/lib/ruby/gems/1.9.1/gems/flog-2.5.0/lib/flog.rb:235:in flog' from F:/Ruby191/lib/ruby/gems/1.9.1/gems/flog-2.5.0/bin/flog:13:in<top
(required)>’
from F:/Ruby192/bin/flog:19:in load' from F:/Ruby192/bin/flog:19:in

_md

On Oct 11, 3:03am, Michel D. [email protected] wrote:

Minimal case : bug appears when adding this two lines
=begin
=end

I’m quite incredulous that someone else has so recently noticed such a
similarly esoteric problem in flog.
The following is my case:

[email protected] $ cat foo.rb

=begin
=end
[email protected] $ ruby foo.rb
[email protected] $ flog foo.rb
C:/Ruby/in-use/lib/ruby/gems/1.8/gems/ruby_parser-2.0.5/lib/
ruby_lexer.rb:739:in yylex': you shouldn't be able to get here (RuntimeError) from C:/Ruby/in-use/lib/ruby/gems/1.8/gems/ruby_parser-2.0.5/lib/ ruby_lexer.rb:649:inloop’
from C:/Ruby/in-use/lib/ruby/gems/1.8/gems/ruby_parser-2.0.5/lib/
ruby_lexer.rb:649:in yylex' from C:/Ruby/in-use/lib/ruby/gems/1.8/gems/ruby_parser-2.0.5/lib/ ruby_lexer.rb:68:inadvance’
from C:/Ruby/in-use/lib/ruby/gems/1.8/gems/ruby_parser-2.0.5/lib/
ruby_parser_extras.rb:712:in next_token' from C:/Ruby/in-use/lib/ruby/1.8/racc/parser.rb:99:in_racc_do_parse_c’
from C:/Ruby/in-use/lib/ruby/1.8/racc/parser.rb:99:in __send__' from C:/Ruby/in-use/lib/ruby/1.8/racc/parser.rb:99:indo_parse’
from C:/Ruby/in-use/lib/ruby/gems/1.8/gems/ruby_parser-2.0.5/lib/
ruby_parser_extras.rb:749:in process' from C:/Ruby/in-use/lib/ruby/gems/1.8/gems/flog-2.5.0/lib/flog.rb: 241:inflog’
from C:/Ruby/in-use/lib/ruby/gems/1.8/gems/flog-2.5.0/lib/flog.rb:
235:in each' from C:/Ruby/in-use/lib/ruby/gems/1.8/gems/flog-2.5.0/lib/flog.rb: 235:inflog’
from C:/Ruby/in-use/lib/ruby/gems/1.8/gems/flog-2.5.0/bin/flog:13
from c:/Ruby/in-use/bin/flog:19:in `load’
from c:/Ruby/in-use/bin/flog:19
[email protected] $ ruby -v
ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]
[email protected] $ gem list flog
flog (2.5.0)

And the plot thickens (same ruby & flog versions):

[email protected] $ cat foo.rb
=begin
=end
[email protected] $ ruby foo.rb
[email protected] $ flog foo.rb
0.0: flog total
0.0: flog/method average

Thoughts?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs