Skip to main content

parse_clause_list

Function parse_clause_list 

Source
pub fn parse_clause_list(text: &str) -> Result<Vec<Clause>, String>
Expand description

Parse a comma-separated clause list — the textual content of one comprehension sub-space.

Splits on commas at paren-depth 0 that are followed (after whitespace) by an <ident> in token. This splits real clause boundaries while leaving:

  • Function-call inner commas: matching_profiles('a', 'b') stays one expression.
  • Multi-value inner commas: limit in 10,20,30 stays one clause whose expression is 10,20,30.

Each entry that doesn’t parse as var in expr produces an error in the result; the function returns the first error encountered.