Refactor Parser trait to pass min_indent

This removes the need to explicitly pass thru min_indent when using the parser combinators.

My ultimate goal here is to evolve the current parser closer toward a purely combinator-based parser,
at which point we can more easily transition smoothly to a formal(ish) grammar, or expand the meanings of combinators
to include things like:
* Incremental (re)parsing
* Unified parsing and formatting code
* Better error recovery
* Using the main parser directly for syntax highlighting
This commit is contained in:
Joshua Warner 2022-10-25 21:03:28 -07:00
parent ae1a9e4dd6
commit 07be8ec000
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
18 changed files with 704 additions and 844 deletions

View file

@ -23,8 +23,9 @@ pub fn criterion_benchmark(c: &mut Criterion) {
let (_actual, state) =
module::parse_header(&arena, State::new(src.as_bytes())).unwrap();
let min_indent = 0;
let res = module_defs()
.parse(&arena, state)
.parse(&arena, state, min_indent)
.map(|tuple| tuple.1)
.unwrap();