diff --git a/crates/varcon-core/src/parser.rs b/crates/varcon-core/src/parser.rs index 1a7ae6f..82c203e 100644 --- a/crates/varcon-core/src/parser.rs +++ b/crates/varcon-core/src/parser.rs @@ -997,12 +997,12 @@ impl Entry { let pos = opt((space1, delimited('<', cut_err(Pos::parse_), cut_err('>')))) .parse_next(input)?; let archaic = opt((space1, archaic)).parse_next(input)?; - let note = opt((space1, NOTE_PREFIX, space1, description)).parse_next(input)?; + let note = opt((space1, note)).parse_next(input)?; let description = opt((space1, description)).parse_next(input)?; entry.pos = pos.map(|(_, p)| p); entry.archaic = archaic.is_some(); - entry.note = note.map(|(_, _, _, d)| d.to_owned()); + entry.note = note.map(|(_, d)| d.to_owned()); entry.description = description.map(|(_, d)| d.to_owned()); } Ok(entry) @@ -1011,6 +1011,11 @@ impl Entry { } } +fn note(input: &mut &str) -> PResult { + let (_, _, note) = (NOTE_PREFIX, space1, description).parse_next(input)?; + Ok(note.to_owned()) +} + const NOTE_PREFIX: &str = "--"; fn archaic(input: &mut &str) -> PResult<(), ()> {