Skip to main content

Module skip

Module skip 

Source
Expand description

SIMD-accelerated skipping utilities for lexing.

Functionsยง

contains_any
Returns true if any byte in input matches any of needles.
count_matches
Returns the number of bytes in input that match any of needles.
find_last
Returns the index of the last byte in input that matches any of needles, or None if 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..=0x1F and 0x7F).
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 (0 or 1).
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 input that matches any of needles.
skip_until_newline
Returns the number of bytes before the first \n, or input.len() if there is no newline. Equivalent to skip_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 input that match any of needles.
skip_whitespace
Returns the length of the leading ASCII whitespace prefix.