Skip to main content

token_at

Function token_at 

Source
pub fn token_at(tokens: &[Token], byte: u32) -> Option<usize>
Expand description

Finds the index of the token covering byte (token.start <= byte < token.end) using O(log N) binary search over a contiguous or monotonic slice of tokens.