Move NODES constant into its proper namespace

This commit is contained in:
Sijawusz Pur Rahnama 2023-05-31 13:15:01 +02:00
parent 6e5a9a60b3
commit 85c3db4d74

View file

@ -1,6 +1,13 @@
require "./base_visitor"
module Ameba::AST
# An AST Visitor that traverses the source and allows all nodes
# to be inspected by rules.
#
# ```
# visitor = Ameba::AST::NodeVisitor.new(rule, source)
# ```
class NodeVisitor < BaseVisitor
# List of nodes to be visited by Ameba's rules.
NODES = {
Alias,
@ -29,13 +36,6 @@ module Ameba::AST
Until,
}
# An AST Visitor that traverses the source and allows all nodes
# to be inspected by rules.
#
# ```
# visitor = Ameba::AST::NodeVisitor.new(rule, source)
# ```
class NodeVisitor < BaseVisitor
@skip : Array(Crystal::ASTNode.class)?
def initialize(@rule, @source, skip = nil)