Exemplo n.º 1
0
 public void AddLookup(RegexItem item, int startLocation, int endLocation, bool canCoalesce)
 {
     if (this.inSeries)
     {
         if (canCoalesce)
         {
             RegexRef ref2 = (RegexRef)this.expressionLookup[this.expressionLookup.Count - 1];
             ref2.StringValue = ref2.StringValue + item.ToString(0);
             ref2.Length     += (endLocation - startLocation) + 1;
         }
         else
         {
             this.expressionLookup.Add(new RegexRef(item, startLocation, endLocation));
             this.inSeries = false;
         }
     }
     else
     {
         if (canCoalesce)
         {
             this.inSeries = true;
         }
         this.expressionLookup.Add(new RegexRef(item, startLocation, endLocation));
     }
 }
        public int CompareTo(object o2)
        {
            RegexRef ref2 = (RegexRef)o2;

            if (this.Length < ref2.Length)
            {
                return(-1);
            }
            if (this.Length > ref2.Length)
            {
                return(1);
            }
            return(0);
        }