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, i.e. offsets before the first token return the first token and offsets after the last token return the last token.

public Token<TKind> Peek(int offset);

View source

Parameters

Name Type Description
offset Int32 The offset from the current position; can be negative to peek at preceding tokens.

Returns

Token<TKind>

The token at the offset.