private int GetPosition(IToken indentationToken) { if (indentationToken.IsEof()) { // Indention is always 0 for EOF return 0; } else { // Indention for whitespace tokens must be calculated return indentationToken .Text .AsEnumerable() .Select(ch => this.GetWhitespaceLength(ch)) .TakeWhile(length => length > 0) .Sum(); } }
public bool IsTrigger(IToken token) { var isFirstInLine = token.CharPositionInLine == 0; return isFirstInLine || token.IsEof(); }
public bool IsTrigger(IToken token) { return token.CharPositionInLine == 0 && !token.IsEof(); }