Skip to content

TokenReader<TKind>.Peek Method ​

Definition ​

Returns the token at the specified offset from the current position, clamped to the ends of the reader, that is, offsets before the first token return the first token and offsets after the last token return the last token.

c#
public Token<TKind> Peek(int offset);

View source

Parameters ​

NameTypeDescription
offsetInt32The offset from the current position; can be negative to peek at preceding tokens.

Returns ​

Token<TKind>

The token at the offset.