Project

General

Profile

Actions

Bug #8628

closed

Parse error with method argument that is a Hash with a specific pattern

Added by dimitri-lo2u (Dimitri Geshef) almost 11 years ago. Updated almost 11 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 2.0.0p195 (2013-05-14) [i386-mingw32]
[ruby-core:55968]

Description

The next two lines cause a parse error

p /=/ => 'works'

/in comment/ => 'fails'

The reported error is:

syntax error, unexpected ',', expecting $end

/in comment/ => 'fails'

^

The issue is caused by the /=/ regexp in the method p call.

Notice that no parse error occurs when the Hash argument is put between parentheses

p(/=/ => 'works').


Files

snippet.rb (319 Bytes) snippet.rb dimitri-lo2u (Dimitri Geshef), 07/12/2013 03:33 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0