internal static AttributeLocation ToAttributeLocation(this Syntax.InternalSyntax.SyntaxToken token) { // NOTE: to match dev10, we're using the value text, rather // than the actual text. For example, "@return" is equivalent // to "return". return(ToAttributeLocation(token.ValueText)); }
internal Enumerator(ref SyntaxTokenList list) { this.parent = list.parent; this.singleNodeOrList = list.node; this.baseIndex = list.index; this.count = list.Count; this.index = -1; this.current = null; this.position = list.position; }
public Enumerator(ref SyntaxTokenList list) { this.parent = list.parent; this.singleNodeOrList = list.node; this.baseIndex = list.index; this.count = list.Count; this.index = this.count; this.current = null; var last = list.LastOrDefault(); this.position = last.Position + last.FullWidth; }
public bool MoveNext() { if (this.count == 0 || index <= 0) { this.current = null; return(false); } index--; this.current = GetGreenNodeAt(this.singleNodeOrList, this.index); this.position -= this.current.FullWidth; return(true); }
/// <summary> /// Advances the enumerator to the next token in the collection. /// </summary> /// <returns>true if the enumerator was successfully advanced to the next element; false if the enumerator /// has passed the end of the collection.</returns> public bool MoveNext() { if (this.count == 0 || this.count <= index + 1) { // invalidate iterator this.current = null; return(false); } index++; // Add the length of the previous node to the offset so that // the next node's offset is reported correctly. if (current != null) { this.position += this.current.FullWidth; } this.current = GetGreenNodeAt(this.singleNodeOrList, this.index); return(true); }
internal void Add(Syntax.InternalSyntax.SyntaxToken item) { CheckSpace(1); nodes[count++] = item; }