Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create generic ftl serializer (#241)
* Start writing up the serializer * Made sure indentation is handled properly * Started handling select expressions * Switched " " to "\t" to make recognising indents easier * Everything from TypeScript's "Serialize resource" test suite passes * Added the rest of the tests * Added a test to make sure subsequent entries with a comment aren't separated by newlines * Fix serializer for fluent-syntax 0.11.0 Botch with only `&str` supported. * Fix empty lines in messages being swallowed * Fix indentation of default asterisk It seems like `*` is supposed to go _inside_ the indent now. * Fix lints * Make `serialize()` generic over `Slice` * Handle rare edge case of line terminating `\r` * Fix redundant line break after after junk * Align parsing of CRLF-terminated patterns `\r\n` was parsed as a separate TextElement of `\n`, whereas `\n` is parsed as part of the antecedent TextElement. * Don't break line before leading dot pattern * Don't implicitly trim when writing literals * Replace roundtrip tests with manipulation tests * Reintroduce roundtrip tests * Move old fixtures into resource files. * Test on unnormalized fixtures as well. * Fix clippy lints * Document serializer mod and pub functions Also make Serializer private. * Replace unwrap with expect * Remove redundant error propogation * BLACKLIST -> IGNORE_LIST * Fix typo * Mention serializer on changelog * Revert c009674 and add crlf.ftl to ignore list Co-authored-by: Michael Bryan <mbryan@autronics.com.au>
- Loading branch information