[ruby-core:76836] [Ruby trunk Bug#12669] syntax error at assinments of command
From:
nobu@...
Date:
2016-08-11 09:34:55 UTC
List:
ruby-core #76836
Issue #12669 has been updated by Nobuyoshi Nakada.
Description updated
----------------------------------------
Bug #12669: syntax error at assinments of command
https://bugs.ruby-lang.org/issues/12669#change-60061
* Author: Nobuyoshi Nakada
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v:
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
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://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>