On Wed, Jan 6, 2010 at 6:21 AM, Andrea C. Granata
<andrea.granata / zephirworks.com> 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 =<<EOF
> # 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