From 590ccb53b20f723ea586532c95c6390e64fc028d Mon Sep 17 00:00:00 2001 From: Alexandre Terrasa Date: Wed, 30 Mar 2022 19:44:15 -0400 Subject: [PATCH] Trim trailing spaces Signed-off-by: Alexandre Terrasa --- lib/syntax_tree/implicits.rb | 10 +++++----- test/node_test.rb | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/syntax_tree/implicits.rb b/lib/syntax_tree/implicits.rb index 191f7a74..3f751e29 100644 --- a/lib/syntax_tree/implicits.rb +++ b/lib/syntax_tree/implicits.rb @@ -11,7 +11,7 @@ def initialize # Adds the implicitly rescued StandardError into a bare rescue clause. For # example, - # + # # begin # rescue # end @@ -29,7 +29,7 @@ def bare_rescue(location) # Adds the implicitly referenced value (local variable or method call) that # is added into a hash when the value of a key-value pair is omitted. For # example, - # + # # { value: } # # becomes @@ -57,14 +57,14 @@ def precedence_parentheses(location) def self.find(program) implicits = new queue = [[nil, program]] - + until queue.empty? parent_node, child_node = queue.shift - + child_node.child_nodes.each do |grand_child_node| queue << [child_node, grand_child_node] if grand_child_node end - + case [parent_node, child_node] in _, Rescue[exception: nil, location:] implicits.bare_rescue(location) diff --git a/test/node_test.rb b/test/node_test.rb index b5b064e6..0622397a 100644 --- a/test/node_test.rb +++ b/test/node_test.rb @@ -151,7 +151,7 @@ def test_assoc guard_version("3.1.0") do def test_assoc_no_value source = "{ key1:, key2: }" - + at = location(chars: 2..7) assert_node(Assoc, "assoc", source, at: at) { |node| node.assocs.first } end @@ -238,7 +238,7 @@ def test_blockarg guard_version("3.1.0") do def test_blockarg_anonymous source = "def method(&); end" - + at = location(chars: 11..12) assert_node(BlockArg, "blockarg", source, at: at) do |node| node.params.contents.block