Bug #1026: grouping expression in class path
http://redmine.ruby-lang.org/issues/show/1026

Author: Shugo Maeda
Status: Open, Priority: Normal
Assigned to: Yukihiro Matsumoto

On Ruby 1.8, yylex() returns '(' instead of tLPAREN if lex_state == EXPR_CLASS,
so a gropuing expression is not permitted in a class path.

$ ruby-1_8 -v -e 'class (Object)::Foo; end'           
ruby 1.8.7 (2009-01-14 revision 21505) [i686-linux]
-e:1: syntax error, unexpected '('
class (Object)::Foo; end
       ^
-e:1: warning: useless use of a constant in void context
$ ruby-trunk -v -e 'class (Object)::Foo; end; p Foo.new'
ruby 1.9.0 (2008-11-25 revision 20352) [i686-linux]
#<Foo:0x8223ce4>

I have heard from Matz that this is a bug of Ruby 1.8.

Other characters such as '[' seem to have the same problem.


----------------------------------------
http://redmine.ruby-lang.org