mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Consider previous_def
implicitly accessing variables, in the same way as super
does
This commit is contained in:
parent
b6f3d41211
commit
bb0c0eeec6
1 changed files with 3 additions and 3 deletions
|
@ -19,7 +19,7 @@ module Ameba::AST
|
||||||
MacroFor,
|
MacroFor,
|
||||||
}
|
}
|
||||||
|
|
||||||
SUPER_NODE_NAME = "super"
|
SPECIAL_NODE_NAMES = %w[super previous_def]
|
||||||
RECORD_NODE_NAME = "record"
|
RECORD_NODE_NAME = "record"
|
||||||
|
|
||||||
@scope_queue = [] of Scope
|
@scope_queue = [] of Scope
|
||||||
|
@ -139,7 +139,7 @@ module Ameba::AST
|
||||||
def visit(node : Crystal::Call)
|
def visit(node : Crystal::Call)
|
||||||
case
|
case
|
||||||
when @current_scope.def?
|
when @current_scope.def?
|
||||||
if node.name == SUPER_NODE_NAME && node.args.empty?
|
if node.name.in?(SPECIAL_NODE_NAMES) && node.args.empty?
|
||||||
@current_scope.arguments.each do |arg|
|
@current_scope.arguments.each do |arg|
|
||||||
variable = arg.variable
|
variable = arg.variable
|
||||||
variable.reference(variable.node, @current_scope).explicit = false
|
variable.reference(variable.node, @current_scope).explicit = false
|
||||||
|
|
Loading…
Reference in a new issue