From 3b2dd279b741bb4483f09546c19eb38fb70c343e Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 23 Aug 2024 11:09:59 -0500 Subject: [PATCH] fix(varcon): Swallow plural annotations --- crates/varcon-core/src/parser.rs | 7 +++---- crates/varcon/src/codegen.rs | 32 ++++++++++++++++---------------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/crates/varcon-core/src/parser.rs b/crates/varcon-core/src/parser.rs index d837d73..cb430a9 100644 --- a/crates/varcon-core/src/parser.rs +++ b/crates/varcon-core/src/parser.rs @@ -992,7 +992,8 @@ impl Entry { fn parse_description(input: &mut &str) -> PResult { trace("description", move |input: &mut &str| { - let (pos, archaic, note, description) = ( + let (_plural, pos, archaic, note, description) = ( + winnow::combinator::opt((winnow::ascii::space1, "")), winnow::combinator::opt((winnow::ascii::space1, delimited('<', Pos::parse_, '>'))), winnow::combinator::opt((winnow::ascii::space1, "(-)")), winnow::combinator::opt((winnow::ascii::space1, "--")), @@ -1341,9 +1342,7 @@ Entry { pos: None, archaic: false, note: false, - description: Some( - "", - ), + description: None, comment: None, } diff --git a/crates/varcon/src/codegen.rs b/crates/varcon/src/codegen.rs index e43b44e..7ac57a4 100644 --- a/crates/varcon/src/codegen.rs +++ b/crates/varcon/src/codegen.rs @@ -12342,7 +12342,7 @@ Cluster { }, ], pos: None, archaic: false, note: false, - description: Some(" [analysis]"), + description: Some("[analysis]"), comment: None, }, ], @@ -49134,7 +49134,7 @@ Cluster { }, ], pos: None, archaic: false, note: false, - description: Some(" [catalysis]"), + description: Some("[catalysis]"), comment: None, }, ], @@ -55294,7 +55294,7 @@ Cluster { }, ], pos: None, archaic: false, note: false, - description: Some(" :2"), + description: Some(":2"), comment: None, }, ], @@ -99099,7 +99099,7 @@ Cluster { }, ], pos: None, archaic: false, note: false, - description: Some(" [dialysis]"), + description: Some("[dialysis]"), comment: None, }, ], @@ -107825,7 +107825,7 @@ Cluster { }, ], pos: None, archaic: false, note: false, - description: Some(""), + description: None, comment: None, }, Entry { @@ -183976,7 +183976,7 @@ Cluster { }, ], pos: None, archaic: false, note: false, - description: Some(" [hydrolysis]"), + description: Some("[hydrolysis]"), comment: None, }, ], @@ -184239,7 +184239,7 @@ Cluster { }, ], pos: None, archaic: false, note: false, - description: Some(""), + description: None, comment: None, }, Entry { @@ -195572,7 +195572,7 @@ Cluster { }, ], pos: None, archaic: false, note: false, - description: Some(""), + description: None, comment: None, }, Entry { @@ -204163,7 +204163,7 @@ Cluster { }, ], pos: None, archaic: false, note: false, - description: Some(""), + description: None, comment: None, }, Entry { @@ -283206,7 +283206,7 @@ Cluster { }, ], pos: None, archaic: false, note: false, - description: Some(" [paralysis]"), + description: Some("[paralysis]"), comment: None, }, ], @@ -322811,7 +322811,7 @@ Cluster { }, ], pos: None, archaic: false, note: false, - description: Some(" [psychoanalysis]"), + description: Some("[psychoanalysis]"), comment: None, }, ], @@ -327022,7 +327022,7 @@ Cluster { }, ], pos: None, archaic: false, note: false, - description: Some(""), + description: None, comment: None, }, ], @@ -330649,7 +330649,7 @@ Cluster { }, ], pos: None, archaic: false, note: false, - description: Some(" [reanalysis]"), + description: Some("[reanalysis]"), comment: None, }, ], @@ -397881,7 +397881,7 @@ Cluster { }, ], pos: None, archaic: false, note: false, - description: Some(" [topi] antelope"), + description: Some("[topi] antelope"), comment: None, }, ], @@ -447581,7 +447581,7 @@ Cluster { }, ], pos: None, archaic: false, note: false, - description: Some(""), + description: None, comment: None, }, ], @@ -449137,7 +449137,7 @@ Cluster { }, ], pos: None, archaic: false, note: false, - description: Some(" :1"), + description: Some(":1"), comment: None, }, Entry {