MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / utf8_char_len

Function utf8_char_len

compiler/src/modules/lexer/tables.rs:161–168  ·  view source on GitHub ↗
(first: u8)

Source from the content-addressed store, hash-verified

159/* UTF-8 byte length from lead byte; supports non-ASCII identifiers. */
160#[inline]
161pub fn utf8_char_len(first: u8) -> usize {
162 match first {
163 0x00..=0x7F => 1,
164 0xC0..=0xDF => 2,
165 0xE0..=0xEF => 3,
166 _ => 4,
167 }
168}
169
170/* Reverse lookup for diagnostics: TokenType -> quoted display name. */
171pub const fn token_to_str(kind: &TokenType) -> &'static str {

Callers 1

next_tokenMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected