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:in
`loop'
        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:in
`advance'
        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:in
`process'
        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:in `each'
        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 `<main>'

_md

···

--
Posted via http://www.ruby-forum.com/.

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

dking1@SDGL07L3AED1G $ cat foo.rb

···

On Oct 11, 3:03 am, Michel Demazure <mic...@demazure.com> wrote:

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

#
=begin
=end
dking1@SDGL07L3AED1G $ ruby foo.rb
dking1@SDGL07L3AED1G $ 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:in `loop'
  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:in `advance'
  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:in `do_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:in `flog'
  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:in `flog'
  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
dking1@SDGL07L3AED1G $ ruby -v
ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]
dking1@SDGL07L3AED1G $ gem list flog
flog (2.5.0)

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

dking1@SDGL07L3AED1G $ cat foo.rb
=begin
=end
dking1@SDGL07L3AED1G $ ruby foo.rb
dking1@SDGL07L3AED1G $ flog foo.rb
     0.0: flog total
     0.0: flog/method average

Thoughts?