AddChild() public method

public AddChild ( Scope childScope ) : void
childScope Scope
return void
Ejemplo n.º 1
0
        private static void AddScopeToNestedScopes(Scope scope,
            ref Scope currentScope,
            ICollection<Scope> capturedStyleTree)
        {
            if (scope.Index >= currentScope.Index &&
                (scope.Index + scope.Length <= currentScope.Index + currentScope.Length)) {
                currentScope.AddChild(scope);
                currentScope = scope;
            }
            else {
                currentScope = currentScope.Parent;

                if (currentScope != null)
                    AddScopeToNestedScopes(scope, ref currentScope, capturedStyleTree);
                else
                    capturedStyleTree.Add(scope);
            }
        }
Ejemplo n.º 2
0
        private static void AddScopeToNestedScopes(Scope scope,
                                                   ref Scope currentScope,
                                                   ICollection <Scope> capturedStyleTree)
        {
            if (scope.Index >= currentScope.Index && (scope.Index + scope.Length <= currentScope.Index + currentScope.Length))
            {
                currentScope.AddChild(scope);
                currentScope = scope;
            }
            else
            {
                currentScope = currentScope.Parent;

                if (currentScope != null)
                {
                    AddScopeToNestedScopes(scope, ref currentScope, capturedStyleTree);
                }
                else
                {
                    capturedStyleTree.Add(scope);
                }
            }
        }