Project

General

Profile

Actions

Bug #12669

closed

syntax error at assinments of command

Bug #12669: syntax error at assinments of command

Added by nobu (Nobuyoshi Nakada) about 9 years ago. Updated about 9 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:76835]

Description

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

Updated by nobu (Nobuyoshi Nakada) about 9 years ago Actions #1 [ruby-core:76836]

  • Description updated (diff)

Updated by nobu (Nobuyoshi Nakada) about 9 years ago Actions #2

  • Status changed from Open to Closed

Applied in changeset r55888.


parse.y: chained assignments

  • parse.y (command_asgn, arg): fix syntax errors with chained
    assignment with op assign. [Bug #12669]

Updated by whitequark (whitequark *) about 9 years ago Actions #3 [ruby-core:77512]

Will this change be backported?

Actions

Also available in: PDF Atom