mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-28 08:53:44 +00:00
Give parser fuzzing some TLC
* The header + expr fuzzers can both be run again (header fuzzer had regressed). * I ran the expr fuzzer for ~60 seconds with no additional panics uncovered * "tab_crash" hit supposedly unreachable code in blankspace.rs - and I went to the liberty of dramatically simplifying all that code, rather than just trying to fix the bug * Other failures were straight-forward error cases that should have been handled (and passed up the chain) instead of panicking
This commit is contained in:
parent
521afce1f4
commit
5f29402297
15 changed files with 176 additions and 475 deletions
|
@ -41,3 +41,15 @@ pub fn parse_defs_with<'a>(arena: &'a Bump, input: &'a str) -> Result<Defs<'a>,
|
|||
Err(tuple) => Err(tuple.1),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn parse_header_with<'a>(
|
||||
arena: &'a Bump,
|
||||
input: &'a str,
|
||||
) -> Result<ast::Module<'a>, SyntaxError<'a>> {
|
||||
let state = State::new(input.trim().as_bytes());
|
||||
|
||||
match crate::module::parse_header(arena, state.clone()) {
|
||||
Ok((header, _)) => Ok(header),
|
||||
Err(fail) => Err(SyntaxError::Header(fail.problem)),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue