1个不稳定版本
0.1.0 | 2021年3月28日 |
---|
#56 in #fluent
2KB
use fluent_fmt::FluentFormatter;
use fluent_syntax::parser::parse;
#[test]
fn parsing() {
let mut ctx = FluentFormatter::default();
let ftl = r#"
### Resource Level Comment
### * Resource Level Comment2
### * Resource Level Comment3
# This is a message comment
time-elapsed = Time elapsed: {
NUMBER($duration, maximumFractionDigits: 0)
}s.
.placeholder = [email protected]
.aria-label = Login input value
.title = Type your login email
"#;
let out = parse(ftl).unwrap();
// println!("{:#?}", out);
println!("{}", ctx.pretty_print(out).unwrap())
}