mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Move NODES
constant into its proper namespace
This commit is contained in:
parent
6e5a9a60b3
commit
85c3db4d74
1 changed files with 28 additions and 28 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue