Skip to main content

parse_multi_lenient

Function parse_multi_lenient 

Source
pub fn parse_multi_lenient(input: &str) -> MultiParseResult
Expand description

Parses a multi-song ChordPro source string leniently, collecting all errors.

Unlike parse_multi, this function does not fail on the first error. Each song segment is parsed independently with parse_lenient, and all errors are collected. The size limit from ParseOptions::default is enforced on the entire input.

ยงExamples

use chordsketch_core::parser::parse_multi_lenient;

let input = "{title: Song One}\n[Am\n{new_song}\n{title: Song Two}\n[G]Hello";
let result = parse_multi_lenient(input);
assert_eq!(result.results.len(), 2);
assert!(result.results[0].has_errors()); // unclosed chord
assert!(result.results[1].is_ok());