From 8f308e73e5275a5d80dea1eb1f896a19d1410fa7 Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Tue, 2 Mar 2021 12:40:46 +0100 Subject: [PATCH] Add ~ as the prefix operator --- spec/ameba/rule/style/verbose_block_spec.cr | 1 + src/ameba/rule/style/verbose_block.cr | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/ameba/rule/style/verbose_block_spec.cr b/spec/ameba/rule/style/verbose_block_spec.cr index 3689cecb..18ffd6fd 100644 --- a/spec/ameba/rule/style/verbose_block_spec.cr +++ b/spec/ameba/rule/style/verbose_block_spec.cr @@ -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 diff --git a/src/ameba/rule/style/verbose_block.cr b/src/ameba/rule/style/verbose_block.cr index d5049091..1a1cbacd 100644 --- a/src/ameba/rule/style/verbose_block.cr +++ b/src/ameba/rule/style/verbose_block.cr @@ -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 = {'[', ']', '!', '=', '>', '<', '~', '+', '-', '*', '/', '%', '^', '|', '&'}