Project

General

Profile

« Previous | Next » 

Revision 4ac8d117

Added by ktsj (Kazuki Tsujimoto) about 2 years ago

* in an array pattern should not be parsed as nil in ripper

After 6c0925ba7017efde6091e2ec4f1a6be268166696, 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.