racc error on new 1.9 hash syntax

M

Michel Demazure

racc 1.4.6 does not understand when parsing " in: value "

F:/Ruby19/lib/ruby/gems/1.9.1/gems/racc-1.4.6/lib/racc/parser.rb:347:in
`on_error': (Racc::parseError)
parse error on value "in" (kIN)
 
A

Aaron Patterson

racc 1.4.6 does not understand when parsing " in: value "

F:/Ruby19/lib/ruby/gems/1.9.1/gems/racc-1.4.6/lib/racc/parser.rb:347:in
`on_error': (Racc::parseError)
parse error on value "in" (kIN)

Racc doesn't actually understand how to parse anything. Someone must
write a grammar that racc uses to generate a parser.

You are seeing an error with the grammar file, not with Racc. What gem
are you using where you see this error? Can we get a larger stack
trace?
 
M

Michel Demazure

Aaron said:
Racc doesn't actually understand how to parse anything. Someone must
write a grammar that racc uses to generate a parser.

You are seeing an error with the grammar file, not with Racc. What gem
are you using where you see this error? Can we get a larger stack
trace?

Thanks for your answer.

It comes from flog via ruby-parser (flay gives the same error):

F:/Ruby19/lib/ruby/gems/1.9.1/gems/racc-1.4.6/lib/racc/parser.rb:347:in
`on_error': (Racc::parseError)
parse error on value "in" (kIN)
from
F:/Ruby19/lib/ruby/gems/1.9.1/gems/racc-1.4.6/lib/racc/parser.rb:99:in
`_racc_do_parse_c'
from
F:/Ruby19/lib/ruby/gems/1.9.1/gems/racc-1.4.6/lib/racc/parser.rb:99:in
`do_parse'
from
F:/Ruby19/lib/ruby/gems/1.9.1/gems/ruby_parser-2.0.4/lib/ruby_parser_extras.rb:749:in
`process'
from
F:/Ruby19/lib/ruby/gems/1.9.1/gems/flog-2.4.0/lib/flog.rb:176:in `block
in flog'
from
F:/Ruby19/lib/ruby/gems/1.9.1/gems/flog-2.4.0/lib/flog.rb:170:in `each'
from
F:/Ruby19/lib/ruby/gems/1.9.1/gems/flog-2.4.0/lib/flog.rb:170:in `flog'
from
F:/Ruby19/lib/ruby/gems/1.9.1/gems/flog-2.4.0/bin/flog:11:in `<top
(required)>'
from F:/Ruby19/bin/flog:19:in `load'
from F:/Ruby19/bin/flog:19:in `<main>'
Of course, 'in' is also a keyword. When using a key which is not a
keyword, the error happens when parsing the colon.
 
R

Ryan Davis

=20
@Ryan : OK, thanks. But what about flog ? Should we just forget it ?

Flog and flay both use ruby_parser to do their work.

So far I haven't had any motivation to get ruby_parser working with =
1.9's syntax changes. I am bribable tho. :D
 
M

Michel Demazure

Ryan said:
Flog and flay both use ruby_parser to do their work.

So far I haven't had any motivation to get ruby_parser working with
1.9's syntax changes. I am bribable tho. :D

The funny fact is that I changed the syntax in my project to please
Saikuro !
There is a saying in French "you cannot please everybody and your wife
!".
M.
 
M

Michel Demazure

A simple preliminary rake task passing files through
gsub!(/(\w+):\s+/, '\1 =>')
solves the problem. It is easier than changing ruby_parser...

Actually, it is quite strange/funny to be able to write hashes like

if: true, raise: SyntaxError

M.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

racc 1.4.6 fails to install on windows 1
Racc fails on install 7
Can't install racc 2
Racc 2
Bug in Racc? 0
Bug on ruby_parser gem? 2
bug in flog ? 1
config.h on Linux for building racc 3

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top