Beispiel #1
0
        internal override void StartScopeForSuccesfulMatch(Scanner s, MatchResult match)
        {
            Scope newScope = this.BuildNewScope(s.TopScope);

            newScope.PosMatchedAt     = match.PosMatchedAt;
            newScope.ExternalCaptures = match.ExternalCaptures;

            bool hasHighlightMode = match.Pattern.HasHighlightMode;

            if (0 == match.PosRegionStart)
            {
                match.PosRegionStart = hasHighlightMode ? match.PosAfterMatch : match.PosMatchStart;
            }

            if (0 == match.PosHighlightStart)
            {
                match.PosHighlightStart = match.PosMatchStart;
            }

            if (hasHighlightMode && match.PosHighlightStart < match.PosRegionStart)
            {
                s.SendMode(match.Pattern.HighlightMode, match.PosHighlightStart);
            }

            newScope.PosStart           = hasHighlightMode ? match.PosRegionStart : match.PosMatchStart;
            newScope.PosHighlightStart  = hasHighlightMode ? match.PosRegionStart : match.PosHighlightStart;
            newScope.PosEndSkippedUntil = hasHighlightMode ? match.PosRegionStart - 1 : match.PosAfterMatch - 1;
            newScope.EatNewLineInRegion = match.Pattern.EatNewLine;

            s.PushScope(newScope);
        }
Beispiel #2
0
        internal override void StartScopeForSuccesfulMatch(Scanner s, MatchResult match)
        {
            Scope newScope = this.BuildNewScope(match, s.TopScope);

            s.PushScope(newScope);

            return;
        }
Beispiel #3
0
        internal override void StartScopeForSuccesfulMatch(Scanner s, MatchResult match)
        {
            Scope newScope = this.BuildNewScope(s.TopScope);
            newScope.PosMatchedAt = match.PosMatchedAt;
            newScope.ExternalCaptures = match.ExternalCaptures;

            bool hasHighlightMode = match.Pattern.HasHighlightMode;

            if (0 == match.PosRegionStart) {
                match.PosRegionStart = hasHighlightMode ? match.PosAfterMatch : match.PosMatchStart;
            }

            if (0 == match.PosHighlightStart) {
                match.PosHighlightStart = match.PosMatchStart;
            }

            if (hasHighlightMode && match.PosHighlightStart < match.PosRegionStart) {
                s.SendMode(match.Pattern.HighlightMode, match.PosHighlightStart);
            }

            newScope.PosStart = hasHighlightMode ? match.PosRegionStart : match.PosMatchStart;
            newScope.PosHighlightStart = hasHighlightMode ? match.PosRegionStart : match.PosHighlightStart;
            newScope.PosEndSkippedUntil = hasHighlightMode ? match.PosRegionStart - 1 : match.PosAfterMatch - 1;
            newScope.EatNewLineInRegion = match.Pattern.EatNewLine;

            s.PushScope(newScope);
        }
Beispiel #4
0
        internal override void StartScopeForSuccesfulMatch(Scanner s, MatchResult match)
        {
            Scope newScope = this.BuildNewScope(match, s.TopScope);
            s.PushScope(newScope);

            return;
        }