Module: Mirah::AST::Scoped
- Included in:
- Block, BlockArgument, Call, ClassAppendSelf, Constant, FunctionalCall, Import, Include, Local, LocalAssignment, LocalDeclaration, MacroDefinition, MethodDefinition, OptionalArgument, RequiredArgument, RescueClause, RestArgument, Scope, ScopedBody, Self, String, Super
- Defined in:
- lib/mirah/ast/scope.rb
Instance Method Summary collapse
Instance Method Details
#containing_scope ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/mirah/ast/scope.rb', line 29 def containing_scope scope = self.scope.static_scope while !scope.shadowed?(name) && scope.parent && scope.parent.include?(name) scope = scope.parent end scope end |
#scope ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/mirah/ast/scope.rb', line 19 def scope @scope ||= begin scope = parent until scope.nil? || scope.class.include?(Scope) scope = scope.parent end scope end end |