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

Function is_fstring_prefix

compiler/src/modules/lexer/tables.rs:126–135  ·  view source on GitHub ↗
(s: &[u8])

Source from the content-addressed store, hash-verified

124/* f-string prefix: f, F, fr, Fr, fR, FR, rf, rF, Rf, RF. */
125#[inline]
126pub fn is_fstring_prefix(s: &[u8]) -> bool {
127 match s.len() {
128 1 => matches!(s[0], b'f' | b'F'),
129 2 => matches!(
130 (s[0], s[1]),
131 (b'f' | b'F', b'r' | b'R') | (b'r' | b'R', b'f' | b'F')
132 ),
133 _ => false,
134 }
135}
136
137/* Regular string prefix: r, R, u, U. The b/B variants live in `is_bytes_prefix` to emit a distinct `Bytes` token. */
138#[inline]

Callers 1

next_tokenMethod · 0.85

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected