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

Function valid_prql_ident

prqlc/prqlc/src/codegen/ast.rs:340–347  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

338}
339
340fn valid_prql_ident() -> &'static Regex {
341 static VALID_PRQL_IDENT: OnceLock<Regex> = OnceLock::new();
342 VALID_PRQL_IDENT.get_or_init(|| {
343 // Pomsky expression (regex is to Pomsky what SQL is to PRQL):
344 // ^ ('*' | [ascii_alpha '_$'] [ascii_alpha ascii_digit '_$']* ) $
345 Regex::new(r"^(?:\*|[a-zA-Z_$][a-zA-Z0-9_$]*)$").unwrap()
346 })
347}
348
349pub fn write_ident_part(s: &str) -> Cow<'_, str> {
350 if valid_prql_ident().is_match(s) && !keywords().contains(s) {

Callers 1

write_ident_partFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected