From: Charles Oliver Nutter Date: 2010-01-06T23:19:45+09:00 Subject: Re: Bug on ruby_parser gem? On Wed, Jan 6, 2010 at 6:21 AM, Andrea C. Granata wrote: > Hi there, > > I think i just found a bug on ruby_parser gem on ruby 1.9.1 > > This is my code: > > # encoding: utf-8 > > require 'rubygems' > require 'ruby_parser' > parser = RubyParser.new > > text =< # encoding: utf-8 > #àè > puts "text" > # ' > EOF > out = parser.process(text) > puts out.inspect > > When I run the code on ruby 1.9.1p376 (2009-12-07 revision 26041) > [i386-darwin10.2.0] i get this error: > > bash-3.2$ ruby test_parser.rb > /Users/andreag/.rvm/gems/ruby/1.9.1/gems/ruby_parser-2.0.4/lib/ruby_lexer.rb:381:in > `rb_compile_error': Invalid char "'" in expression. near line 5: "#" > (SyntaxError) This looks like an incompatibility rather than a bug. As far as I know, ruby_parser primarily supports 1.8, and I don't know how much testing has happened against 1.9. Either way, you should probably try to report it...somewhere :) I think ruby_parser is a great project to have, since it allows equivalent parser support across all Ruby implementations without any native code. - Charlie