allow windows newlines in TDB2 files

This commit is contained in:
Dustin J. Mitchell 2022-01-08 22:34:29 +00:00
parent 69d052603d
commit 5019ecb4f8

View file

@ -27,7 +27,8 @@ impl File {
fn parse(input: &str) -> IResult<&str, File> {
all_consuming(fold_many0(
terminated(Line::parse, char('\n')),
// allow windows or normal newlines
terminated(Line::parse, pair(opt(char('\r')), char('\n'))),
File { lines: vec![] },
|mut file, line| {
file.lines.push(line);