mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Fix newly found issue
This commit is contained in:
parent
1524aad299
commit
f45d6a2ef0
1 changed files with 4 additions and 5 deletions
|
@ -122,11 +122,10 @@ module Ameba::AST
|
|||
# `false` if not.
|
||||
def used_in_macro?(scope = @scope)
|
||||
scope.inner_scopes.each do |inner_scope|
|
||||
return true if MacroReferenceFinder.new(inner_scope.node, node.name).references
|
||||
return true if MacroReferenceFinder.new(inner_scope.node, node.name).references?
|
||||
end
|
||||
return true if MacroReferenceFinder.new(scope.node, node.name).references
|
||||
return true if (outer_scope = scope.outer_scope) &&
|
||||
used_in_macro?(outer_scope)
|
||||
return true if MacroReferenceFinder.new(scope.node, node.name).references?
|
||||
return true if (outer_scope = scope.outer_scope) && used_in_macro?(outer_scope)
|
||||
|
||||
false
|
||||
end
|
||||
|
@ -169,7 +168,7 @@ module Ameba::AST
|
|||
end
|
||||
|
||||
private class MacroReferenceFinder < Crystal::Visitor
|
||||
property references = false
|
||||
property? references = false
|
||||
|
||||
def initialize(node, @reference : String = reference)
|
||||
node.accept self
|
||||
|
|
Loading…
Reference in a new issue