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

Function is_path_value_text

codegraph-kernel/src/rustlang.rs:1703–1707  ·  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

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

Callers 1

maybe_capture_fn_refsMethod · 0.85

Calls 1

allMethod · 0.65

Tested by

no test coverage detected