diff options
author | Kazuki Tsujimoto <kazuki@callcc.net> | 2023-04-01 16:28:05 +0900 |
---|---|---|
committer | Kazuki Tsujimoto <kazuki@callcc.net> | 2023-04-01 16:35:24 +0900 |
commit | 4ac8d1172483634bb24183b8ad2aaa03435b17a3 (patch) | |
tree | da84c2d3427b9dec3b90295bf493620f16eb5a53 /parse.y | |
parent | 3a238eff88440f450a7871fc82e49bfb1ab336e5 (diff) | |
download | ruby-4ac8d1172483634bb24183b8ad2aaa03435b17a3.tar.gz |
`*` 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.
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -4656,7 +4656,7 @@ p_rest : tSTAR tIDENTIFIER /*%%%*/ $$ = 0; /*% %*/ - /*% ripper: Qnil %*/ + /*% ripper: var_field(p, Qnil) %*/ } ; |