Microsoft.R.Core.AST.ScopeExtensions.EnumerateTowardsGlobal C# (CSharp) Method

EnumerateTowardsGlobal() public static method

Enumerates scopes from the current up to the global scope.
public static EnumerateTowardsGlobal ( this scope ) : IEnumerable
scope this
return IEnumerable
        public static IEnumerable<IScope> EnumerateTowardsGlobal(this IScope scope) {
            yield return scope;
            while (!(scope is GlobalScope)) {
                scope = scope.GetEnclosingScope();
                yield return scope;
            }
        }