public SeparatedSyntaxList(SyntaxNodeOrTokenList list) { Validate(list); int allCount = list.Count; Count = (allCount + 1) >> 1; SeparatorCount = allCount >> 1; _list = list; }
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."); } } }
internal Enumerator(SyntaxNodeOrTokenList list) : this() { _list = list; _index = -1; }