mirror of
https://github.com/crate-ci/typos.git
synced 2024-11-21 16:41:01 -05:00
refactor(varcon): Flatten description parsing
This commit is contained in:
parent
095c7aecc2
commit
1e9d9813a0
1 changed files with 15 additions and 15 deletions
|
@ -993,21 +993,21 @@ impl Entry {
|
|||
|
||||
fn parse_description(input: &mut &str) -> PResult<Self, ()> {
|
||||
trace("description", move |input: &mut &str| {
|
||||
let (_abbr, _plural, pos, archaic, note, description) = (
|
||||
winnow::combinator::opt((winnow::ascii::space1, "<abbr>")),
|
||||
winnow::combinator::opt((winnow::ascii::space1, "<pl>")),
|
||||
winnow::combinator::opt((
|
||||
winnow::ascii::space1,
|
||||
delimited('<', cut_err(Pos::parse_), cut_err('>')),
|
||||
)),
|
||||
winnow::combinator::opt((winnow::ascii::space1, "(-)")),
|
||||
winnow::combinator::opt((winnow::ascii::space1, "--")),
|
||||
winnow::combinator::opt((
|
||||
winnow::ascii::space1,
|
||||
winnow::token::take_till(0.., ('\n', '\r', '#')),
|
||||
)),
|
||||
)
|
||||
.parse_next(input)?;
|
||||
let _ = winnow::combinator::opt((winnow::ascii::space1, "<abbr>")).parse_next(input)?;
|
||||
let _ = winnow::combinator::opt((winnow::ascii::space1, "<pl>")).parse_next(input)?;
|
||||
let pos = winnow::combinator::opt((
|
||||
winnow::ascii::space1,
|
||||
delimited('<', cut_err(Pos::parse_), cut_err('>')),
|
||||
))
|
||||
.parse_next(input)?;
|
||||
let archaic =
|
||||
winnow::combinator::opt((winnow::ascii::space1, "(-)")).parse_next(input)?;
|
||||
let note = winnow::combinator::opt((winnow::ascii::space1, "--")).parse_next(input)?;
|
||||
let description = winnow::combinator::opt((
|
||||
winnow::ascii::space1,
|
||||
winnow::token::take_till(0.., ('\n', '\r', '#')),
|
||||
))
|
||||
.parse_next(input)?;
|
||||
|
||||
let variants = Vec::new();
|
||||
let pos = pos.map(|(_, p)| p);
|
||||
|
|
Loading…
Reference in a new issue