Project

General

Profile

Bug #12669

Updated by nobu (Nobuyoshi Nakada) over 8 years ago

Related to #12402, I found other kind inconsistencies. 

 simple assignment and op assign of `command` cause syntax error, 
 while simple assignments don't. 

 ``` 
 $ ruby -ce 'a = b = raise "x"' 
 Syntax OK 
 ``` 
 ``` 
 $ ruby -ce 'a = b += raise "x"' 
 -e:1: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '(' 
 a = b += raise "x" 
                 ^ 
 ``` 
 ``` 
 $ ruby -ce 'a += b = raise "x"' 
 -e:1: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '(' 
 a += b = raise "x" 
                 ^ 
 ``` 
 ``` 
 $ ruby -ce 'a += b += raise "x"' 
 -e:1: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '(' 
 a += b += raise "x" 
                  ^ 
 ``` 

 https://github.com/ruby/ruby/compare/trunk...nobu:chained-rhs https://github.com/ruby/ruby/compare/trunk...nobu:rhs-command

Back