Beispiel #1
0
 public SegmentedString(SegmentedString other)
 {
     m_pushedChar1   = other.m_pushedChar1;
     m_pushedChar2   = other.m_pushedChar2;
     m_currentString = new SegmentedSubstring(other.m_currentString);
     if (m_pushedChar2 != 0)
     {
         m_currentChar = m_pushedChar2;
     }
     else if (m_pushedChar1 != 0)
     {
         m_currentChar = m_pushedChar1;
     }
     else
     {
         m_currentChar = m_currentString.m_length != 0 ? m_currentString.getCurrentChar() : '\0';
     }
     m_numberOfCharactersConsumedPriorToCurrentString = other.m_numberOfCharactersConsumedPriorToCurrentString;
     m_numberOfCharactersConsumedPriorToCurrentLine   = other.m_numberOfCharactersConsumedPriorToCurrentLine;
     m_currentLine   = other.m_currentLine;
     m_substrings    = new List <SegmentedSubstring>(other.m_substrings);
     m_closed        = other.m_closed;
     m_empty         = other.m_empty;
     m_fastPathFlags = other.m_fastPathFlags;
     m_advanceFunc   = other.m_advanceFunc;
     m_advanceAndUpdateLineNumberFunc = other.m_advanceAndUpdateLineNumberFunc;
 }
Beispiel #2
0
 public void push(char c)
 {
     if (m_pushedChar1 == 0)
     {
         m_pushedChar1 = c;
         m_currentChar = m_pushedChar1 != 0 ? m_pushedChar1 : m_currentString.getCurrentChar();
         updateSlowCaseFunctionPointers();
     }
     else
     {
         Debug.Assert(m_pushedChar2 == 0);
         m_pushedChar2 = c;
     }
 }