Beispiel #1
0
            protected override bool ScanSpan(ref int i)
            {
                int textOffset = i - StartOffset;

                switch (CurRule.Name)
                {
                case "Comment":
                case "String":
                case "VerbatimString":
                    return(base.ScanSpan(ref i));

                default:
                    if (!DSyntaxMode.EnableConditionalHighlighting)
                    {
                        return(base.ScanSpan(ref i));
                    }

                    break;
                }

                bool stacked = false;

                var inv = SyntaxMode.invalidCodeRegionTree;

                if (inv != null)
                {
                    foreach (var segm in inv.GetSegmentsAt(i))
                    {
                        stacked = true;
                        var span = new CCSpan();
                        base.FoundSpanBegin(span, segm.Offset, 0);
                        base.FoundSpanEnd(span, i = segm.EndOffset, 0);
                        break;
                    }
                }

                if (stacked)
                {
                    return(true);
                }

                return(base.ScanSpan(ref i));
            }
Beispiel #2
0
            protected override bool ScanSpan(ref int i)
            {
                int textOffset = i - StartOffset;
                switch(CurRule.Name)
                {
                    case "Comment":
                    case "String":
                    case "VerbatimString":
                        return base.ScanSpan(ref i);
                    default:
                        if(!DSyntaxMode.EnableConditionalHighlighting)
                            return base.ScanSpan(ref i);

                        break;
                }

                bool stacked = false;

                var inv = SyntaxMode.invalidCodeRegionTree;
                if(inv != null)
                    foreach (var segm in inv.GetSegmentsAt(i))
                    {
                        stacked = true;
                        var span = new CCSpan();
                        base.FoundSpanBegin(span, segm.Offset, 0);
                        base.FoundSpanEnd(span, i = segm.EndOffset, 0);
                        break;
                    }

                if (stacked)
                    return true;

                return base.ScanSpan(ref i);
            }