[ruby-core:114288] [Ruby master Bug#19025] Ripper cannot parse syntax ok code that has numbered parameters

Issue #19025 has been updated by usa (Usaku NAKAMURA). Backport changed from 3.0: REQUIRED, 3.1: REQUIRED, 3.2: DONE to 3.0: REQUIRED, 3.1: DONE, 3.2: DONE ruby_3_1 e55dde3bdddbc595be12e7184a23e729647eb989 merged revision(s) 91c004885fc75a93cadf0094fa86ec3bd0ec25f5. ---------------------------------------- Bug #19025: Ripper cannot parse syntax ok code that has numbered parameters https://bugs.ruby-lang.org/issues/19025#change-103984 * Author: tompng (tomoya ishida) * Status: Closed * Priority: Normal * ruby -v: ruby 3.2.0dev (2022-09-22T02:42:57Z :detached: 830b2e217b) [x86_64-linux] * Backport: 3.0: REQUIRED, 3.1: DONE, 3.2: DONE ---------------------------------------- Ruby says `p { a = 0; [_1, _1 **2] }` is syntax ok, Ripper says syntax error ~~~ruby 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 ~~~ruby 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 ~~~ -- https://bugs.ruby-lang.org/
participants (1)
-
usa (Usaku NAKAMURA)