Example #1
0
        public SeparatedSyntaxList(SyntaxNodeOrTokenList list)
        {
            Validate(list);

            int allCount = list.Count;

            Count          = (allCount + 1) >> 1;
            SeparatorCount = allCount >> 1;

            _list = list;
        }
Example #2
0
 private static void Validate(SyntaxNodeOrTokenList list)
 {
     for (int i = 0; i < list.Count; i++)
     {
         var item = list[i];
         if ((i & 1) == 0)
         {
             Debug.Assert(item.IsNode, "Node missing in separated list.");
         }
         else
         {
             Debug.Assert(item.IsToken, "Separator token missing in separated list.");
         }
     }
 }
Example #3
0
 internal Enumerator(SyntaxNodeOrTokenList list)
     : this()
 {
     _list  = list;
     _index = -1;
 }