Skip to main content

parse

Function parse 

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

Parse the model’s text. It is asked for a JSON array of {“file”,“line”,“severity”,“text”} with severity one of “high”,“medium”,“low”, and [] when there is nothing to raise. Accept the array bare or inside a ```json fence, with surrounding prose. Unknown severities become “low”; entries without “text” are dropped. Empty or whitespace-only text → Err(“empty response”). Unparseable text → Err(String) with the first 200 characters of the text.