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
1
2
3
4
5
6
7
8
9
10
11
12
13
use fluent4rs::{ast::Resource, prelude::Parser};
use pretty_assertions::assert_eq;

#[test]
fn resource_can_be_created_from_entries_only() {
    let ftl0 = include_str!("data/full_grammar_example.ftl");
    let ast0 = Parser::parse(ftl0).unwrap();

    let entries = Vec::from_iter(ast0.entries().into_iter().cloned());
    let ast1 = Resource::from(entries);

    assert_eq!(ast1.entries(), ast0.entries());
}