mirror of
https://github.com/crate-ci/typos.git
synced 2024-11-25 10:31:02 -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, ()> {
|
fn parse_description(input: &mut &str) -> PResult<Self, ()> {
|
||||||
trace("description", move |input: &mut &str| {
|
trace("description", move |input: &mut &str| {
|
||||||
let (_abbr, _plural, pos, archaic, note, description) = (
|
let _ = winnow::combinator::opt((winnow::ascii::space1, "<abbr>")).parse_next(input)?;
|
||||||
winnow::combinator::opt((winnow::ascii::space1, "<abbr>")),
|
let _ = winnow::combinator::opt((winnow::ascii::space1, "<pl>")).parse_next(input)?;
|
||||||
winnow::combinator::opt((winnow::ascii::space1, "<pl>")),
|
let pos = winnow::combinator::opt((
|
||||||
winnow::combinator::opt((
|
winnow::ascii::space1,
|
||||||
winnow::ascii::space1,
|
delimited('<', cut_err(Pos::parse_), cut_err('>')),
|
||||||
delimited('<', cut_err(Pos::parse_), cut_err('>')),
|
))
|
||||||
)),
|
.parse_next(input)?;
|
||||||
winnow::combinator::opt((winnow::ascii::space1, "(-)")),
|
let archaic =
|
||||||
winnow::combinator::opt((winnow::ascii::space1, "--")),
|
winnow::combinator::opt((winnow::ascii::space1, "(-)")).parse_next(input)?;
|
||||||
winnow::combinator::opt((
|
let note = winnow::combinator::opt((winnow::ascii::space1, "--")).parse_next(input)?;
|
||||||
winnow::ascii::space1,
|
let description = winnow::combinator::opt((
|
||||||
winnow::token::take_till(0.., ('\n', '\r', '#')),
|
winnow::ascii::space1,
|
||||||
)),
|
winnow::token::take_till(0.., ('\n', '\r', '#')),
|
||||||
)
|
))
|
||||||
.parse_next(input)?;
|
.parse_next(input)?;
|
||||||
|
|
||||||
let variants = Vec::new();
|
let variants = Vec::new();
|
||||||
let pos = pos.map(|(_, p)| p);
|
let pos = pos.map(|(_, p)| p);
|
||||||
|
|
Loading…
Reference in a new issue