[#114181] [Ruby master Bug#19767] [Not really a bug, but more a not ideal notification] "historical binary regexp match" when using the "n" modifier in a ruby regex — "rubyFeedback (robert heiler) via ruby-core" <ruby-core@...>
SXNzdWUgIzE5NzY3IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IHJ1YnlGZWVkYmFjayAocm9iZXJ0IGhl
3 messages
2023/07/14
[ruby-core:114292] [Ruby master Bug#19025] Ripper cannot parse syntax ok code that has numbered parameters
From:
"usa (Usaku NAKAMURA) via ruby-core" <ruby-core@...>
Date:
2023-07-26 02:04:45 UTC
List:
ruby-core #114292
Issue #19025 has been updated by usa (Usaku NAKAMURA).
Backport changed from 3.0: REQUIRED, 3.1: DONE, 3.2: DONE to 3.0: REQUIRED, 3.1: REQUIRED, 3.2: DONE
reverted on ruby_3_1 because the test is not passed...
----------------------------------------
Bug #19025: Ripper cannot parse syntax ok code that has numbered parameters
https://bugs.ruby-lang.org/issues/19025#change-103990
* 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: REQUIRED, 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/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/