Expand description
SIMD-accelerated skipping utilities for lexing.
Functionsยง
- contains_
any - Returns
trueif any byte ininputmatches any ofneedles. - count_
matches - Returns the number of bytes in
inputthat match any ofneedles. - find_
last - Returns the index of the last byte in
inputthat matches any ofneedles, orNoneif no byte matches. - skip_
alpha - Returns the length of the leading ASCII alphabetic prefix.
- skip_
alphanumeric - Returns the length of the leading ASCII alphanumeric prefix.
- skip_
ascii - Returns the length of the leading ASCII byte prefix (bytes
0x00..=0x7F). - skip_
ascii_ control - Returns the length of the leading ASCII control character prefix
(
0x00..=0x1Fand0x7F). - skip_
ascii_ graphic - Returns the length of the leading ASCII graphic character prefix (
0x21..=0x7E, i.e. printable non-space characters). - skip_
binary - Returns the length of the leading ASCII binary-digit prefix (
0or1). - skip_
digits - Returns the length of the leading ASCII decimal-digit prefix (
0..=9). - skip_
hex_ digits - Returns the length of the leading ASCII hexadecimal-digit prefix.
- skip_
ident - Returns the length of the leading C-style identifier-continuation prefix.
- skip_
ident_ start - Returns the length of the leading C-style identifier-start prefix.
- skip_
lower - Returns the length of the leading ASCII lowercase prefix (
a..=z). - skip_
non_ ascii - Returns the length of the leading non-ASCII byte prefix (bytes
0x80..=0xFF). - skip_
octal_ digits - Returns the length of the leading ASCII octal-digit prefix (
0..=7). - skip_
until - Returns the index of the first byte in
inputthat matches any ofneedles. - skip_
until_ newline - Returns the number of bytes before the first
\n, orinput.len()if there is no newline. Equivalent toskip_until(input, b'\n').unwrap_or(input.len()). - skip_
upper - Returns the length of the leading ASCII uppercase prefix (
A..=Z). - skip_
while - Returns the number of leading bytes in
inputthat match any ofneedles. - skip_
whitespace - Returns the length of the leading ASCII whitespace prefix.