Project

General

Profile

Actions

Bug #1026

closed

grouping expression in class path

Added by shugo (Shugo Maeda) about 15 years ago. Updated almost 13 years ago.

Status:
Closed
Target version:
-
ruby -v:
[ruby-core:21453]

Description

=begin
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.
=end

Actions #1

Updated by matz (Yukihiro Matsumoto) about 15 years ago

=begin
Hi,

In message "Re: [ruby-core:21453] [Bug #1026] grouping expression in class path"
on Tue, 20 Jan 2009 16:33:03 +0900, Shugo Maeda writes:

|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
| ^

Fixed. I think other maintained 1.8 releases should merge this fix as
well, if maintainers consent.

						matz.

=end

Actions #2

Updated by matz (Yukihiro Matsumoto) about 15 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r21688.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0