Ameba::AST::TopLevelNodesVisitor - ameba 1.7.0

# class Ameba::AST::TopLevelNodesVisitor

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

##
Overview

AST Visitor that visits certain nodes at a top level, which can characterize the source (i.e. require statements, modules etc.)

##
Defined in:

ameba/ast/visitors/top_level_nodes_visitor.cr

##
Constructors

- .new(node : Crystal::ASTNode)

  Creates a new instance of visitor

##
Instance Method Summary

- #require_nodes : Array(Crystal::Require)
- #visit(node : Crystal::Expressions)

  If a top level node is `Crystal::Expressions`, then always traverse the children.

- #visit(node : Crystal::ASTNode)

  A general visit method for rest of the nodes.

##
Constructor Detail

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

Creates a new instance of visitor

##
Instance Method Detail

def require_nodes : Array(Crystal::Require) #
def visit(node : Crystal::Expressions) #

If a top level node is `Crystal::Expressions`, then always traverse the children.

def visit(node : Crystal::ASTNode) #

A general visit method for rest of the nodes. Returns `false`, meaning all child nodes will not be traversed.