[ruby-core:76835] [Ruby trunk Bug#12669] syntax error at assinments of command

From: nobu@...
Date: 2016-08-11 09:32:42 UTC
List: ruby-core #76835
Issue #12669 has been reported by Nobuyoshi Nakada.

----------------------------------------
Bug #12669: syntax error at assinments of command
https://bugs.ruby-lang.org/issues/12669

* 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:rhs-command



-- 
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>

In This Thread

Prev Next