Releases: projectfluent/python-fluent
fluent.syntax 0.16.0
-
Parser fix for selector expressions being too lenient.
This includes the fixes for projectfluent/fluent#279.
fluent.syntax 0.15.1
-
Comment Serializer fix.
The serializer had a bug when asked to serialize empty comments.
fluent.syntax 0.15.0
-
Support Fluent Syntax 1.0.
Fluent Syntax 1.0 has been published today. There are no changes to the
grammar nor the AST compared to the Syntax 0.9.
fluent.syntax 0.14.0
This release of fluent.syntax brings support for version 0.9 of the Fluent
Syntax spec. The API remains unchanged. Files written in valid Syntax 0.8 may
parse differently in this release. See the compatibility note below. Consult
the full Syntax 0.9 changelog for details.
-
Flatten complex reference expressions.
Reference expressions which may take complex forms, such as a reference
to a message's attribute, or a parameterized reference to an attribute of
a term, are now stored in a simplified manner. Instead of nesting
multiple expression nodes (e.g.CallExpressionof an
AttributeExpressionof aTermReference), all information is available
directly in the reference expression.This change affects the following AST nodes:
MessageReferencenow has an optionalattributefield,FunctionReferencenow has a requiredargumentsfield,TermReferencenow has an optionalattributefield and an optional
argumentsfield.
-
Remove
VariantLists.The
VariantListsand theVariantExpressionsyntax and AST nodes were
deprecated in Syntax 0.9 and have now been removed. -
Rename
StringLiteral.rawtovalue.StringLiteral.valuecontains the exact contents of the string literal,
character-for-character. Escape sequences are stored verbatim without
processing. A new method,Literal.parse, can be used to process the raw
value of the literal into an unescaped form. -
Rename
argstoarguments.The
argsfield ofMessageReference,TermReference,
FunctionReference, andAnnotationhas been renamed toarguments.
Backward-incompatible changes:
VariantListsare no longer valid syntax. A syntax error is reported
when aVariantListor aVariantExpressionis found in the parsed file
fluent.syntax 0.13.0
-
Make
BaseNode.equalsstricter when comparing lists.Starting from this version,
BaseNode.equalsnow takes the order of
variants and attributes into account when comparing two nodes. -
Remove
FluentSerializer.serialize_expression.The stateless equivalent can still be imported from
fluent.syntax.serializer:from fluent.syntax.serializer import serialize_expression
fluent.syntax 0.12.0
-
Fixes to the
VisitorAPIThe
VisitorAPI introduced in 0.11 was changed to align more with
what Python'sast.Visitordoes. This also allows implementations
to have code after descending into child nodes.
fluent.syntax 0.11.0
-
API enhancements
There are two new APIs in
fluent.syntax.ast,VisitorandTransformer.
Use these APIs for read-only iteration over AST trees, and in-place mutation
of AST trees, respectively. There's also a new methodBaseNode.clone,
which can be used to create a deep copy of an AST node. -
DEPRECATIONS
The API
BaseNode.traverseis deprecated and will be removed in a future
release. Please adjust your code to theVisitororTransformerAPIs.
fluent.runtime 0.1
First release to PyPI of fluent.runtime. This release contains a FluentBundle implementation that can generate transaltions from FTL spec. It targets the Fluent 0.6 spec.
fluent.syntax 0.10.0
The fluent package which used to provide the fluent.syntax module has been renamed to fluent.syntax on PyPI. The code is identical to fluent 0.10.
fluent 0.10.0
This release brings support for version 0.8 of the Fluent Syntax spec. The API remains unchanged. Files written in valid Syntax 0.7 may not parse correctly in this release. See the summary of backwards-incompatible changes below.
-
Implement Fluent Syntax 0.8. (#303)
This is only a quick summary of the spec changes in Syntax 0.8. Consult the full changelog for details.
In multiline
Patterns, all common indent is now removed from each indented line in the final value of the pattern.multiline = This message has 2 spaces of indent on the second line of its value.Termscan now be parameterized via the call expression syntax.# A parametrized Term with a Pattern as a value. -thing = { $article -> *[definite] the thing [indefinite] a thing } this = This is { -thing(article: "indefinite") }.
VariantListsare now deprecated and will be removed from the Syntax before version 1.0.All escapes sequences can only be used in
StringLiteralsnow (see below).\UHHHHHHis a new escape sequence format suitable for codepoints above U+FFFF, e.g.{"\U01F602"}.
Backward-incompatible changes:
- The backslash character (
\) is now considered a regular character inTextElements. It's no longer possible to use escape sequences inTextElements. Please useStringLiteralsinstead, e.g.{"\u00A0"}. - The closing curly brace character (
}) is not allowed inTextElementsnow. Please useStringLiteralsinstead:{"}"}. StringLiteral.valuewas changed to store the unescaped ("cooked") value.StringLiteral.rawhas been added to store the raw value.- The AST of
CallExpressionswas changed to better accommodate the introduction of parameterizedTerms. TheFunctionAST node has been replaced by theFunctionReferencenode. - The leading dash (
-) is no longer part of theIdentifiernode inTermsandTermReferences.