From 76a4209706cda7f5e2e1621de1b6409a5c000f7f Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Tue, 15 Nov 2022 17:41:53 +0100 Subject: [PATCH] Tweak comments in `AST::Util` --- src/ameba/ast/util.cr | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ameba/ast/util.cr b/src/ameba/ast/util.cr index 39b3df88..e69ee5f8 100644 --- a/src/ameba/ast/util.cr +++ b/src/ameba/ast/util.cr @@ -91,7 +91,7 @@ module Ameba::AST::Util node_lines.join('\n') end - # Returns true if node is a flow command, false - otherwise. + # Returns `true` if node is a flow command, `false` otherwise. # Node represents a flow command if it is a control expression, # or special call node that interrupts execution (i.e. raise, exit, abort). def flow_command?(node, in_loop) @@ -107,7 +107,7 @@ module Ameba::AST::Util end end - # Returns true if node is a flow expression, false if not. + # Returns `true` if node is a flow expression, `false` if not. # Node represents a flow expression if it is full-filled by a flow command. # # For example, this node is a flow expression, because each branch contains @@ -159,25 +159,25 @@ module Ameba::AST::Util nodes.all? { |exp| flow_expression? exp, in_loop } end - # Returns true if node represents `raise` method call. + # Returns `true` if node represents `raise` method call. def raise?(node) node.is_a?(Crystal::Call) && node.name == "raise" && node.args.size == 1 && node.obj.nil? end - # Returns true if node represents `exit` method call. + # Returns `true` if node represents `exit` method call. def exit?(node) node.is_a?(Crystal::Call) && node.name == "exit" && node.args.size <= 1 && node.obj.nil? end - # Returns true if node represents `abort` method call. + # Returns `true` if node represents `abort` method call. def abort?(node) node.is_a?(Crystal::Call) && node.name == "abort" && node.args.size <= 2 && node.obj.nil? end - # Returns true if node represents a loop. + # Returns `true` if node represents a loop. def loop?(node) case node when Crystal::While, Crystal::Until