Ejemplo n.º 1
0
        internal void UpdateScopeIndex(int referencedScopeIndex, SemanticResolver sr)
        {
            ScopeRegion definingScopeRegion = sr.GetDefiningScopeRegion(referencedScopeIndex);

            if (this._innermostReferencedScopeRegion != null && this._innermostReferencedScopeRegion.ScopeRegionIndex >= definingScopeRegion.ScopeRegionIndex)
            {
                return;
            }
            this._innermostReferencedScopeRegion = definingScopeRegion;
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Updates referenced scope index of the aggregate.
        ///     Function call is not allowed after <see cref="ValidateAndComputeEvaluatingScopeRegion" /> has been called.
        /// </summary>
        internal void UpdateScopeIndex(int referencedScopeIndex, SemanticResolver sr)
        {
            Debug.Assert(
                _evaluatingScopeRegion == null, "Can not update referenced scope index after _evaluatingScopeRegion have been computed.");

            var referencedScopeRegion = sr.GetDefiningScopeRegion(referencedScopeIndex);

            if (_innermostReferencedScopeRegion == null
                ||
                _innermostReferencedScopeRegion.ScopeRegionIndex < referencedScopeRegion.ScopeRegionIndex)
            {
                _innermostReferencedScopeRegion = referencedScopeRegion;
            }
        }