isTokenAtAs

inline fun <T : Token> isTokenAtAs(index: Int): Boolean

Returns true if the child at index is a token of type T.

Return

true if the child is a token of type T, false otherwise

Parameters

T

The expected token type

index

The zero-based index of the child


inline fun <T : Token> isTokenAtAs(index: Int, noinline predicate: (token: T) -> Boolean): Boolean

Returns true if the child at index is a token of type T that satisfies the predicate.

Return

true if the child is a token of type T and satisfies the predicate, false otherwise

Parameters

T

The expected token type

index

The zero-based index of the child

predicate

A function that tests the token