public void SetEndingTest1()
      {
         CCommentedCodeFragment target = new CCommentedCodeFragment(new CElementPosition(12, 123), new CPair<string>("/*", "*/"));

         long _LineEnd = 45;
         int _IndexEnd = 3453;
         target.SetEnding(_LineEnd, _IndexEnd);
         Assert.AreEqual(_LineEnd, target.LineEnd);
         Assert.AreEqual(_IndexEnd, target.IndexEnd);
      }
Esempio n. 2
0
 private void AddFragment(int _LineEnd, int _IndexEnd)
 {
     if (m_PairCommentStack.Count > 0)
     {
         CCommentedCodeFragment ready_fragment = m_PairCommentStack.Pop();
         ready_fragment.SetEnding(_LineEnd, _IndexEnd);
         if (ready_fragment.IsBelongOneLine())
         {
             m_OnelineCodeFragments.Add(ready_fragment);
         }
         else
         {
             CCommentedCodeFragment new_fragment = new CCommentedCodeFragment(new CElementPosition(_LineEnd, 0, _LineEnd, _IndexEnd), ready_fragment.CommentSymbolPair);
             m_OnelineCodeFragments.Add(new_fragment);
         }
     }
 }