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

Function is_path_value_text

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

1670
1671/// A path value's text as normalizeSpecial accepts it: `/^[A-Za-z_][\w:#]*$/`.
1672fn is_path_value_text(s: &str) -> bool {
1673 let mut chars = s.chars();
1674 matches!(chars.next(), Some(c) if c.is_ascii_alphabetic() || c == '_')
1675 && chars.all(|c| c.is_ascii_alphanumeric() || c == '_' || c == ':' || c == '#')
1676}
1677
1678/// JS `\s` (WhiteSpace ∪ LineTerminator), which `.replace(/\s+/g, '')` strips:
1679/// 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