GetRangeAt() private method

private GetRangeAt ( int i ) : SingleRange
i int
return SingleRange
コード例 #1
0
 internal void AddCharClass(RegexCharClass cc)
 {
     if (!cc._canonical)
     {
         this._canonical = false;
     }
     else if ((this._canonical && (this.RangeCount() > 0)) && ((cc.RangeCount() > 0) && (cc.GetRangeAt(0)._first <= this.GetRangeAt(this.RangeCount() - 1)._last)))
     {
         this._canonical = false;
     }
     for (int i = 0; i < cc.RangeCount(); i++)
     {
         this._rangelist.Add(cc.GetRangeAt(i));
     }
     this._categories.Append(cc._categories.ToString());
 }
コード例 #2
0
        /*
         * AddCharClass()
         *
         * Adds a regex char class
         */
        internal void AddCharClass(RegexCharClass cc) {
            int i;

            Debug.Assert(cc.CanMerge && this.CanMerge, "Both character classes added together must be able to merge" );
            
            if (!cc._canonical) {
                // if the new char class to add isn't canonical, we're not either.
                _canonical = false;
            }
            else if (_canonical && RangeCount() > 0 && cc.RangeCount() > 0 && cc.GetRangeAt(0)._first <= GetRangeAt(RangeCount() - 1)._last)
                _canonical = false;

            for (i = 0; i < cc.RangeCount(); i += 1) {
                _rangelist.Add(cc.GetRangeAt(i));
            }

            _categories.Append(cc._categories.ToString());
        }