Commit 00f1499
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>1 parent d53526f commit 00f1499
File tree
11 files changed
+832
-1
lines changed- fluent-syntax
- src
- tests
- fixtures/normalized
11 files changed
+832
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
0 commit comments