Example #1
0
        private StringSelection Include(StringSelection sel)
        {
            if (IsError)
            {
                return(this);
            }
            var sel1  = this;
            var sel2  = sel;
            var index = sel1._Start.Index;

            if (sel2._Start.Index < sel1._Start.Index)
            {
                index = sel2._Start.Index;
            }
            var endIndex = sel1._End.Index;

            if (sel2._End.Index > sel1._End.Index)
            {
                endIndex = sel2._End.Index;
            }
            return(_Start.Source.Select(index, endIndex - index));
        }
Example #2
0
 public StringSelection Select(int length)
 {
     return(StringSelection.TryCreate(this, length));
 }
Example #3
0
 public Token(TokenType tt, StringSelection sel)
 {
     Type      = tt;
     Selection = sel;
 }