mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Add QoL Variable#reference(scope)
method
This commit is contained in:
parent
444b07c179
commit
ce3f2b7e4b
2 changed files with 6 additions and 3 deletions
|
@ -72,6 +72,11 @@ module Ameba::AST
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# :ditto:
|
||||||
|
def reference(scope : Scope)
|
||||||
|
reference(node, scope)
|
||||||
|
end
|
||||||
|
|
||||||
# Reference variable's assignments.
|
# Reference variable's assignments.
|
||||||
#
|
#
|
||||||
# ```
|
# ```
|
||||||
|
|
|
@ -178,9 +178,7 @@ module Ameba::AST
|
||||||
when scope.type_definition? && accessor_macro?(node) then return false
|
when scope.type_definition? && accessor_macro?(node) then return false
|
||||||
when scope.def? && special_node?(node)
|
when scope.def? && special_node?(node)
|
||||||
scope.arguments.each do |arg|
|
scope.arguments.each do |arg|
|
||||||
variable = arg.variable
|
ref = arg.variable.reference(scope)
|
||||||
|
|
||||||
ref = variable.reference(variable.node, scope)
|
|
||||||
ref.explicit = false
|
ref.explicit = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue