Issue #8628 has been updated by dimitri-lo2u (Dimitri Geshef).


First detected in ruby 1.9.3p374 (2013-01-15) [i386-mingw32]
----------------------------------------
Bug #8628: Parse error with method argument that is a Hash with a specific pattern
https://bugs.ruby-lang.org/issues/8628#change-40464

Author: dimitri-lo2u (Dimitri Geshef)
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: ruby 2.0.0p195 (2013-05-14) [i386-mingw32]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


# 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').


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