Bug #5571
closedSyntax Error when put String eql? with logical operation ("||") or "("&&")
Description
There has a syntax error when try to connect two string eqls? with the logical operation ("||") and ("&&") as below
{code}
ruby-head :001 > test="test"
=> "test"
ruby-head :002 > puts test.eql?("test") || test.eql?("test1")
true
=> nil
ruby-head :003 > puts test.eql?"test" || test.eql?"test1"
SyntaxError: (irb):3: syntax error, unexpected tSTRING_BEG, expecting $end
puts test.eql?"test" || test.eql?"test1"
^
from /usr/local/rvm/rubies/ruby-head/bin/irb:16:in <main>' ruby-head :004 > puts (test.eql?("test") || test.eql?("test1")) true => nil ruby-head :005 > puts (test.eql?"test" || test.eql?"test1") SyntaxError: (irb):5: syntax error, unexpected tSTRING_BEG, expecting ')' puts (test.eql?"test" || test.eql?"test1") ^ (irb):5: syntax error, unexpected ')', expecting $end from /usr/local/rvm/rubies/ruby-head/bin/irb:16:in
'
ruby-head :006 >
{code}