Actions
Bug #19025
closedRipper cannot parse syntax ok code that has numbered parameters
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.2.0dev (2022-09-22T02:42:57Z :detached: 830b2e217b) [x86_64-linux]
Description
Ruby says p { a = 0; [_1, _1 **2] }
is syntax ok, Ripper says syntax error
code = 'p { a = 0; [_1, _1 **2] }'
eval(code) #=> nil (Syntax OK)
Ripper.sexp(code) #=> nil (Syntax Error)
Other similar codes. maybe not a bug
p { a = 0; [a **2] } # Syntax OK
p { a = 0; [_1 **2] } # Syntax Error
p { a = 0; [a, _1 **2] } # Syntax Error
p { a = 0; [_1, _1 **2] } # Syntax OK, Ripper.sexp says Syntax Error
Actions
Like0
Like0Like0Like0Like0Like0