django-ftl / fluent-compiler

High performance Python implementation of Fluent, Mozilla's l10n language
Other
21 stars 4 forks source link

Fixed bug in compiler.py related to variable reuse #27

Closed ggindinson closed 3 months ago

ggindinson commented 3 months ago

This bug caused the following error:

AttributeError: 'Block' object has no attribute 'variable'

You can easily reproduce the bug trying to use 2 functions in 1 text with same variable like this:

`example = My name is { $name-> [Peter] Peter11 *[other] Jane11 }

My gender is { $name-> [Peter] Male *[other] Female }`

spookylukey commented 3 months ago

Thanks so much for this. I've created another PR with a test - #29 - and cherry-picked your commit onto it. I'll release a new version when I'm done.