Exemplo n.º 1
0
        /// <summary>
        /// Closes the scope, used at the end of adding items to the scope.
        /// </summary>
        /// <param name="scope">The outer scope, used to attach a fallback mechanism to each
        /// scope, optionally, by default not effective.</param>
        public override void CloseScope(IZincIdentScope scope = null)
        {
            base.CloseScope(scope);
            Dictionary <IZincIdent, IZincIdent> replace = new Dictionary <IZincIdent, IZincIdent> ();

            foreach (Tuple <IZincIdentScope, IZincIdent> matcher in ICompositionUtils.DoubleBlanket <IZincIdentScope, IZincElement> (this, StandardFunctions.AllPredicate <IZincElement> (), x => x is IZincIdent, StandardFunctions.AllPredicate <IZincIdentScope> ()).Cast <Tuple <IZincIdentScope, IZincIdent> > ())
            {
                replace.Add(matcher.Item2, matcher.Item1.NameRegister.Lookup(matcher.Item2));
            }
            this.Replace(replace);
        }