MCPcopy Create free account
hub / github.com/PRQL/prql / valid_ident

Function valid_ident

prqlc/prqlc/src/utils/mod.rs:82–93  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

80}
81
82pub(crate) fn valid_ident() -> &'static Regex {
83 static VALID_IDENT: OnceLock<Regex> = OnceLock::new();
84 VALID_IDENT.get_or_init(|| {
85 // One of:
86 // - `*`
87 // - An ident starting with `a-z_\$` and containing other characters `a-z0-9_\$`
88 //
89 // We could replace this with pomsky (regex<>pomsky : sql<>prql)
90 // ^ ('*' | [ascii_lower '_$'] [ascii_lower ascii_digit '_$']* ) $
91 Regex::new(r"^((\*)|(^[a-z_\$][a-z0-9_\$]*))$").unwrap()
92 })
93}
94
95fn should_use_color() -> bool {
96 match anstream::AutoStream::choice(&stderr()) {

Callers 1

translate_ident_partFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected