Closed Bug 1396778 Opened 8 years ago Closed 8 years ago

Parser: Support multiline variants

Categories

(L20n :: Python Library, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: stas, Unassigned)

References

Details

Let's unskip these tests: @unittest.skip("Parsing error") def test_variant_multiline_first_inline(self): input = """\ foo = { *[a] AAA BBB } """ self.assertEqual(pretty_ftl(input), dedent_ftl(input)) @unittest.skip("Parsing error") def test_variant_multiline(self): input = """\ foo = { *[a] AAA BBB } """ self.assertEqual(pretty_ftl(input), dedent_ftl(input))
:stas, it seems to work in the parser. Can you confirm?
Flags: needinfo?(stas)
Ha, interesting. I only tried unskipping these tests before I submitted this bug, and indeed one of them still fails, but the reason is different. I did some research. It looks like the parsing bug was fixed along the way when I landed https://github.com/projectfluent/python-fluent/pull/17. The first test still fails today because the Serializer sees a new line between AAA and BBB and decides to format the whole variant as a multi-line block. I filed bug 1397760 to make a decision about this behavior. The second test fails because the variant is indented by 7 and not 8 spaces. That's an easy fix, and I'll land it without review. Thanks for looking into this, Zibi!
Flags: needinfo?(stas)
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.