mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Use tuple instead of an array
This commit is contained in:
parent
8b43a40a65
commit
2c67fe2c3f
3 changed files with 6 additions and 6 deletions
|
@ -241,7 +241,7 @@ module Ameba
|
||||||
end
|
end
|
||||||
|
|
||||||
class TestNodeVisitor < Crystal::Visitor
|
class TestNodeVisitor < Crystal::Visitor
|
||||||
NODES = [
|
NODES = {
|
||||||
Crystal::NilLiteral,
|
Crystal::NilLiteral,
|
||||||
Crystal::Var,
|
Crystal::Var,
|
||||||
Crystal::Assign,
|
Crystal::Assign,
|
||||||
|
@ -255,7 +255,7 @@ module Ameba
|
||||||
Crystal::MacroLiteral,
|
Crystal::MacroLiteral,
|
||||||
Crystal::Expressions,
|
Crystal::Expressions,
|
||||||
Crystal::ControlExpression,
|
Crystal::ControlExpression,
|
||||||
]
|
}
|
||||||
|
|
||||||
def initialize(node)
|
def initialize(node)
|
||||||
node.accept self
|
node.accept self
|
||||||
|
|
|
@ -2,7 +2,7 @@ require "./base_visitor"
|
||||||
|
|
||||||
module Ameba::AST
|
module Ameba::AST
|
||||||
# List of nodes to be visited by Ameba's rules.
|
# List of nodes to be visited by Ameba's rules.
|
||||||
NODES = [
|
NODES = {
|
||||||
Alias,
|
Alias,
|
||||||
IsA,
|
IsA,
|
||||||
Assign,
|
Assign,
|
||||||
|
@ -27,7 +27,7 @@ module Ameba::AST
|
||||||
When,
|
When,
|
||||||
While,
|
While,
|
||||||
Until,
|
Until,
|
||||||
]
|
}
|
||||||
|
|
||||||
# An AST Visitor that traverses the source and allows all nodes
|
# An AST Visitor that traverses the source and allows all nodes
|
||||||
# to be inspected by rules.
|
# to be inspected by rules.
|
||||||
|
|
|
@ -4,7 +4,7 @@ module Ameba::AST
|
||||||
# AST Visitor that traverses the source and constructs scopes.
|
# AST Visitor that traverses the source and constructs scopes.
|
||||||
class ScopeVisitor < BaseVisitor
|
class ScopeVisitor < BaseVisitor
|
||||||
# Non-exhaustive list of nodes to be visited by Ameba's rules.
|
# Non-exhaustive list of nodes to be visited by Ameba's rules.
|
||||||
NODES = [
|
NODES = {
|
||||||
ClassDef,
|
ClassDef,
|
||||||
ModuleDef,
|
ModuleDef,
|
||||||
EnumDef,
|
EnumDef,
|
||||||
|
@ -17,7 +17,7 @@ module Ameba::AST
|
||||||
Block,
|
Block,
|
||||||
Macro,
|
Macro,
|
||||||
MacroFor,
|
MacroFor,
|
||||||
]
|
}
|
||||||
|
|
||||||
SUPER_NODE_NAME = "super"
|
SUPER_NODE_NAME = "super"
|
||||||
RECORD_NODE_NAME = "record"
|
RECORD_NODE_NAME = "record"
|
||||||
|
|
Loading…
Reference in a new issue