Ameba::AST::CountingVisitor - ameba 1.7.0

# class Ameba::AST::CountingVisitor

- Ameba::AST::CountingVisitor
- Crystal::Visitor
- Reference
- Object

##
Overview

AST Visitor that counts occurrences of certain keywords

##
Defined in:

ameba/ast/visitors/counting_visitor.cr

##
Constant Summary

DEFAULT_COMPLEXITY = `1`

##
Constructors

- .new(node : Crystal::ASTNode)

  Creates a new counting visitor

##
Instance Method Summary

- #count : Int32

  Returns the number of keywords that were found in the node

- #macro_condition? : Bool

  Returns `true` if the node is within a macro condition

- #visit(node : Crystal::MacroIf | Crystal::MacroFor)

##
Constructor Detail

def self.new(node : Crystal::ASTNode) #

Creates a new counting visitor

##
Instance Method Detail

def count : Int32 #

Returns the number of keywords that were found in the node

def macro_condition? : Bool #

Returns `true` if the node is within a macro condition

def visit(node : Crystal::MacroIf | Crystal::MacroFor) #