Merge pull request #4758 from joshuawarner32/fuzzing-take-2

Add fuzzing for the formatter and fix bugs
This commit is contained in:
Ayaz 2022-12-22 06:35:34 -07:00 committed by GitHub
commit dbdf4acdd7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
58 changed files with 1286 additions and 471 deletions

View file

@ -620,6 +620,7 @@ pub enum PInParens<'a> {
pub enum EType<'a> {
Space(BadInputError, Position),
UnderscoreSpacing(Position),
TRecord(ETypeRecord<'a>, Position),
TTagUnion(ETypeTagUnion<'a>, Position),
TInParens(ETypeInParens<'a>, Position),
@ -1203,18 +1204,6 @@ where
}
}
pub fn fail_when_progress<T, E>(
progress: Progress,
fail: E,
value: T,
state: State<'_>,
) -> ParseResult<'_, T, E> {
match progress {
MadeProgress => Err((MadeProgress, fail)),
NoProgress => Ok((NoProgress, value, state)),
}
}
pub fn optional<'a, P, T, E>(parser: P) -> impl Parser<'a, Option<T>, E>
where
P: Parser<'a, T, E>,