Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.95k stars 554 forks source link

B::Deparse: retain () around ! if omitting them would warn #22669

Open mauke opened 1 week ago

mauke commented 1 week ago

Since 570fa43328, we emit precedence warnings if the LHS of a comparison or binding op starts with an unparenthesized logical negation (!, as in !$x == $y). Explicit parens can be used to avoid the warning ((!$x) == $y).

Teach B::Deparse to keep these parentheses even if they're not strictly required by operator precedence because we don't want the deparsed code to generate more warnings than the original code.

Fixes #22661.