Skip to main content

split_respecting_parens

Function split_respecting_parens 

Source
pub fn split_respecting_parens(s: &str) -> Vec<String>
Expand description

Split a comma-separated clause list on clause boundaries.

A clause boundary is a comma at paren-depth 0 followed (after whitespace) by an <ident> in token, where <ident> is a Rust-style identifier. The lookahead is the only reliable signal — the YAML grammar above doesn’t supply any other syntactic boundary, so a comma might be a new clause OR a comma inside a value list / function call.

Returns the parts as owned Strings so callers don’t thread the input lifetime through every step. Empty parts (consecutive commas, leading/trailing whitespace) are preserved here and dropped in parse_clause_list.