fluent4rs 2.3.1

Parser / codec for [Fluent FTL files](https://github.com/projectfluent/fluent/blob/master/spec/fluent.ebnf), written for [lingora](https://github.com/nigeleke/lingora) (a localization management program), and may be found to be useful outside of that context. It is not intended to replace any aspects of the [fluent-rs](https://github.com/projectfluent/fluent-rs) crate implemented by [Project Fluent](https://projectfluent.org/), and, for the majority of language translation needs, the reader is referred back to that crate.
Documentation
use std::hint::black_box;

use criterion::{Criterion, criterion_group, criterion_main};
use fluent4rs::{ast::Resource, prelude::Parser};

fn bench_parse(c: &mut Criterion) {
    let medium = black_box(include_str!("../tests/data/full_grammar_example.ftl"));

    let inputs = [("full_grammar_example", medium)];

    inputs
        .iter()
        .filter(|(_, input)| !input.is_empty())
        .for_each(|(name, input)| {
            c.bench_function(&format!("parse_{}", name), |b| {
                b.iter(|| {
                    let _ast: Resource = Parser::parse(black_box(input)).unwrap();
                    black_box(_ast);
                })
            });
        });
}

criterion_group!(benches, bench_parse);
criterion_main!(benches);