jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • JRuby
  • JRUBY-3316

Group expression class path fails to parse

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: JRuby 1.2
  • Component/s: Parser
  • Labels:
    None

Description

From Ruby's redmine: http://redmine.ruby-lang.org/issues/show/1026

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.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Charles Oliver Nutter added a comment - 20/Jan/09 3:49 AM

Matz fixed this for MRI in r21688.

Show
Charles Oliver Nutter added a comment - 20/Jan/09 3:49 AM Matz fixed this for MRI in r21688.
Hide
Permalink
Thomas E Enebo added a comment - 16/Feb/09 4:26 PM

Fixed in commit 9199. I apparently did most of Matz's original patch some time ago (not sure if this was because of 1.9 grammar or I noticed it was not DRY). In any case this ended up being a one-liner.

Show
Thomas E Enebo added a comment - 16/Feb/09 4:26 PM Fixed in commit 9199. I apparently did most of Matz's original patch some time ago (not sure if this was because of 1.9 grammar or I noticed it was not DRY). In any case this ended up being a one-liner.

People

  • Assignee:
    Thomas E Enebo
    Reporter:
    Charles Oliver Nutter
Vote (0)
Watch (0)

Dates

  • Created:
    20/Jan/09 2:23 AM
    Updated:
    21/Mar/09 1:14 PM
    Resolved:
    16/Feb/09 4:26 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.