Repository navigation
Conversation
alerque
self-requested a review
September 28, 2026 08:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #286.
For a block pattern whose line starts with an indented placeable:
key12 = { "." } fourthe parser skipped the placeable line's leading spaces and then dropped the resulting empty text slice. That line never counted toward the common indent, so only
four's line did (8). All 8 spaces were stripped and the message parsed the same as iffourhad been indented by 4.The fix: when a line-start text slice ends at a placeable, its indent now counts toward the common indent and it is kept as a text element, like the
Indenttoken in fluent.js'sgetPattern/dedent. Elements that are empty after dedenting are dropped, so placeable lines at the common indent produce the same AST as before.Examples:
{ "." }at 4 spaces,fourat 8 →" four"(was"four")aat 4,{ x }at 8 →"a\n"," ",{ x }(the placeable's extra indent used to be lost)Tests
tests/fixtures/normalized/messages.ftl. Without the parser changeroundtrip_normalized_fixturesfails (the line is reserialized asfour). With it, the test passes.cargo test --workspace: all passcargo fmt --all -- --checkandcargo clippy -p fluent-syntax --all-targets: cleancrlf.ftlhas to stay inIGNORE_LIST. Its roundtrip still fails for an unrelated reason: the CRLFValue 02/\ntext-element split differs from the reparsed LF output.