projectfluent / fluent-rs

Rust implementation of Project Fluent
https://projectfluent.org
Apache License 2.0
1.04k stars 95 forks source link

Parser swallows leading whitespace after indented placeable #286

Open RumovZ opened 1 year ago

RumovZ commented 1 year ago

In this fixture, the leading whitespace in front of "four" is preserved as expected:

key12 =
{ "." }
    four

However, with normalized indentation, it is not:

key12 =
    { "." }
        four

This is wrongly parsed to the same AST as this:

key12 =
    { "." }
    four
gregtatum commented 1 year ago

I'm tentatively marking this as a good first issue since it will probably be a relatively small patch, but you should probably like parsers if you want to take this one.

RumovZ commented 1 year ago

When this is fixed, crlf.ftl may be removed from the IGNORE_LIST in fluent-syntax/tests/serializer_fixtures.rs.