parse error on value "=" (tEQL) #5

Closed
daveinman opened this Issue Mar 13, 2012 · 4 comments

Comments

Projects
None yet
2 participants

ruby 1.9.1p378 (2010-01-10 revision 26273) [i686-linux]
flog 2.5.3

Given the file 'blob.rb' contains this:

lam = lambda { |buf, fatal=false|
    puts fatal
}
lam.call('stuff')

'ruby blob.rb' produces:

false

flog produces:

ERROR: parsing ruby file blob.rb
ERROR! Aborting. You may want to run with --continue.
/home/davei/.gem/ruby/1.9.1/gems/racc-1.4.7/lib/racc/parser.rb:347:in `on_error':  (Racc::ParseError)
parse error on value "=" (tEQL)
        from /home/davei/.gem/ruby/1.9.1/gems/racc-1.4.7/lib/racc/parser.rb:99:in `_racc_do_parse_c'
        from /home/davei/.gem/ruby/1.9.1/gems/racc-1.4.7/lib/racc/parser.rb:99:in `do_parse'
        from /home/davei/.gem/ruby/1.9.1/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:750:in `process'
        from /home/davei/.gem/ruby/1.9.1/gems/flog-2.5.3/lib/flog.rb:241:in `block in flog'
        from /home/davei/.gem/ruby/1.9.1/gems/flog-2.5.3/lib/flog.rb:235:in `each'
        from /home/davei/.gem/ruby/1.9.1/gems/flog-2.5.3/lib/flog.rb:235:in `flog'
        from /home/davei/.gem/ruby/1.9.1/gems/flog-2.5.3/bin/flog:13:in `<top (required)>'
        from /home/davei/.gem/ruby/1.9.1/bin/flog:19:in `load'
        from /home/davei/.gem/ruby/1.9.1/bin/flog:19:in `<main>'

The only way I found the problem was a binary search / commenting half the code at at time. The
best solution would be to eat what ruby 1.9 eats for syntax and second best would be a line number
or the line in error to be output when encountering this syntax.

Thanks,
Dave

Owner

zenspider commented Mar 14, 2012

Flog uses ruby_parser which doesn't (yet) parse 1.9. Sorry. Until RP passes all it's tests, flog simply can't pretend to support 1.9 at all. Feel free to take a whack an RP's remaining failing tests tho.

@zenspider zenspider closed this Mar 14, 2012

Understood. Thanks.

I'm not sure if the flog architecture allows capturing a line number
from ruby_parser,
but it would help a lot if it did.

I use flog quite a bit. I use ruby 1.9 exclusively, but it's pretty
rare that I use one of
its newer forms of syntax. I'm happy to report flog is helping me under
1.9.

Dave

On 03/13/2012 05:21 PM, Ryan Davis wrote:

Flog uses ruby_parser which doesn't (yet) parse 1.9. Sorry. Until RP passes all it's tests, flog simply can't pretend to support 1.9 at all. Feel free to take a whack an RP's remaining failing tests tho.


Reply to this email directly or view it on GitHub:
#5 (comment)

Owner

zenspider commented Mar 14, 2012

On Mar 13, 2012, at 17:29 , daveinman wrote:

Understood. Thanks.

I'm not sure if the flog architecture allows capturing a line number
from ruby_parser,
but it would help a lot if it did.

Unfortunately, racc doesn't make this an easy task... I'd happily accept a pull req on it, but at this point I don't have the time or energy to take a whack at it.

Feel free to open a separate ticket on the ruby_parser project for that. Maybe someone will pick up the ball.

I am out of the office today and will read your email upon my
return.
Dave Inman

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment