Be more lenient with indentation in record parsing

... and extract a shared helper with collection_trailing_sep_e, thereby resolving some inconsistencies with normal collection parsing.

... and delete some dead code while I'm at it
This commit is contained in:
Joshua Warner 2023-01-01 10:18:25 -08:00
parent 6bdab37541
commit 07ebc81cba
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
9 changed files with 202 additions and 225 deletions

View file

@ -27,6 +27,15 @@ where
)
}
pub fn spaces_around<'a, P, S, E>(parser: P) -> impl Parser<'a, Loc<S>, E>
where
S: 'a + Spaceable<'a>,
P: 'a + Parser<'a, Loc<S>, E>,
E: 'a + SpaceProblem,
{
parser::map_with_arena(and(spaces(), and(parser, spaces())), spaces_around_help)
}
pub fn space0_around_e_no_after_indent_check<'a, P, S, E>(
parser: P,
indent_before_problem: fn(Position) -> E,