Add ~ as the prefix operator

This commit is contained in:
Sijawusz Pur Rahnama 2021-03-02 12:40:46 +01:00
parent a169b12b99
commit 8f308e73e5
2 changed files with 2 additions and 1 deletions

View file

@ -84,6 +84,7 @@ module Ameba::Rule::Style
source = Source.new %(
(1..3).sum { |i| +i }
(1..3).sum { |i| -i }
(1..3).sum { |i| ~i }
)
rule = VerboseBlock.new
rule

View file

@ -51,7 +51,7 @@ module Ameba::Rule::Style
a_location.line_number == b_location.line_number
end
private PREFIX_OPERATORS = {"+", "-"}
private PREFIX_OPERATORS = {"+", "-", "~"}
private OPERATOR_CHARS =
{'[', ']', '!', '=', '>', '<', '~', '+', '-', '*', '/', '%', '^', '|', '&'}