Skip to content
  • Kazuki Tsujimoto's avatar
    4ac8d117
    `*` in an array pattern should not be parsed as nil in ripper · 4ac8d117
    Kazuki Tsujimoto authored
    After 6c0925ba, it was impossible
    to distinguish between the presence or absence of `*`.
    
        # Before the commit
        Ripper.sexp('0 in []')[1][0][2][1]  #=> [:aryptn, nil, nil, nil, nil]
        Ripper.sexp('0 in [*]')[1][0][2][1] #=> [:aryptn, nil, nil, [:var_field, nil], nil]
    
        # After the commit
        Ripper.sexp('0 in []')[1][0][2][1]  #=> [:aryptn, nil, nil, nil, nil]
        Ripper.sexp('0 in [*]')[1][0][2][1] #=> [:aryptn, nil, nil, nil, nil]
    
    This commit reverts it.
    4ac8d117
    `*` in an array pattern should not be parsed as nil in ripper
    Kazuki Tsujimoto authored
    After 6c0925ba, it was impossible
    to distinguish between the presence or absence of `*`.
    
        # Before the commit
        Ripper.sexp('0 in []')[1][0][2][1]  #=> [:aryptn, nil, nil, nil, nil]
        Ripper.sexp('0 in [*]')[1][0][2][1] #=> [:aryptn, nil, nil, [:var_field, nil], nil]
    
        # After the commit
        Ripper.sexp('0 in []')[1][0][2][1]  #=> [:aryptn, nil, nil, nil, nil]
        Ripper.sexp('0 in [*]')[1][0][2][1] #=> [:aryptn, nil, nil, nil, nil]
    
    This commit reverts it.
Loading