There are numeric literals with + and - before, separated by a whitespace:
+ and - are handled differently by Prism::Translation::Parser there:
$ bundle exec ruby -Ilib -rprism -ve 'p Prism::Translation::ParserCurrent.parse("- 42")'
ruby 3.4.5 (2025-07-16 revision 20cda200d3) +PRISM [x86_64-linux]
s(:int, -42)
$ bundle exec ruby -Ilib -rprism -ve 'p Prism::Translation::ParserCurrent.parse("+ 42")'
ruby 3.4.5 (2025-07-16 revision 20cda200d3) +PRISM [x86_64-linux]
s(:send,
s(:int, 42), :+@)
- 42 is considered as a plain literal (seems not correct), while + 42 as an unary method call.
Prism itself considers the both as unary method calls.
I suspect handling - should be fixed.
There are numeric literals with
+and-before, separated by a whitespace:+and-are handled differently byPrism::Translation::Parserthere:- 42is considered as a plain literal (seems not correct), while+ 42as an unary method call.Prism itself considers the both as unary method calls.
I suspect handling
-should be fixed.