Set the ASTNode#visibility as well

This commit is contained in:
Sijawusz Pur Rahnama 2023-06-08 04:28:17 +02:00
parent 262e31c35b
commit e12d72cc88
2 changed files with 3 additions and 1 deletions

View file

@ -89,6 +89,8 @@ module Ameba::AST
CRYSTAL
rule.scopes.size.should eq 3
rule.scopes.each &.visibility.should eq Crystal::Visibility::Private
rule.scopes.last.node.visibility.should eq Crystal::Visibility::Private
rule.scopes[0...-1].each &.node.visibility.should eq Crystal::Visibility::Public
end
end
end

View file

@ -73,7 +73,7 @@ module Ameba::AST
# :nodoc:
def visit(node : Crystal::VisibilityModifier)
@visibility_modifier = node.modifier
@visibility_modifier = node.exp.visibility = node.modifier
true
end