MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / is_path_value_text

Function is_path_value_text

codegraph-kernel/src/rustlang.rs:1698–1702  ·  view source on GitHub ↗

A path value's text as normalizeSpecial accepts it: `/^[A-Za-z_][\w:#]*$/`.

(s: &str)

Source from the content-addressed store, hash-verified

1696
1697/// A path value's text as normalizeSpecial accepts it: `/^[A-Za-z_][\w:#]*$/`.
1698fn is_path_value_text(s: &str) -> bool {
1699 let mut chars = s.chars();
1700 matches!(chars.next(), Some(c) if c.is_ascii_alphabetic() || c == '_')
1701 && chars.all(|c| c.is_ascii_alphanumeric() || c == '_' || c == ':' || c == '#')
1702}
1703
1704/// JS `\s` (WhiteSpace ∪ LineTerminator), which `.replace(/\s+/g, '')` strips:
1705/// unlike Rust's `char::is_whitespace`, U+FEFF yes and U+0085 no.

Callers 2

maybe_capture_fn_refsMethod · 0.85
macro_capture_valueFunction · 0.85

Calls 1

allMethod · 0.65

Tested by

no test coverage detected