summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorKazuki Tsujimoto <kazuki@callcc.net>2023-04-01 16:28:05 +0900
committerKazuki Tsujimoto <kazuki@callcc.net>2023-04-01 16:35:24 +0900
commit4ac8d1172483634bb24183b8ad2aaa03435b17a3 (patch)
treeda84c2d3427b9dec3b90295bf493620f16eb5a53 /parse.y
parent3a238eff88440f450a7871fc82e49bfb1ab336e5 (diff)
downloadruby-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.y2
1 files changed, 1 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index 4ff8644c47..f371185ee0 100644
--- a/parse.y
+++ b/parse.y
@@ -4656,7 +4656,7 @@ p_rest : tSTAR tIDENTIFIER
/*%%%*/
$$ = 0;
/*% %*/
- /*% ripper: Qnil %*/
+ /*% ripper: var_field(p, Qnil) %*/
}
;