Skip to content
  • Kevin Newton's avatar
    0321f2c8
    [ruby/prism] Handle implicit array precedence · 0321f2c8
    Kevin Newton authored
    When an implicit array is used in a write, is causes the whole
    expression to become a statement. For example:
    
    ```ruby
    a = *b
    a = 1, 2, 3
    ```
    
    Even though these expressions are exactly equivalent to their
    explicit array counterparts:
    
    ```ruby
    a = [*b]
    a = [1, 2, 3]
    ```
    
    As such, these expressions cannot be joined with other expressions
    by operators or modifiers except if, unless, while, until, or
    rescue.
    
    https://github.com/ruby/prism/commit/7cd2407272
    0321f2c8
    [ruby/prism] Handle implicit array precedence
    Kevin Newton authored
    When an implicit array is used in a write, is causes the whole
    expression to become a statement. For example:
    
    ```ruby
    a = *b
    a = 1, 2, 3
    ```
    
    Even though these expressions are exactly equivalent to their
    explicit array counterparts:
    
    ```ruby
    a = [*b]
    a = [1, 2, 3]
    ```
    
    As such, these expressions cannot be joined with other expressions
    by operators or modifiers except if, unless, while, until, or
    rescue.
    
    https://github.com/ruby/prism/commit/7cd2407272
Loading