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.CallExpression
of an
AttributeExpression
of aTermReference
), all information is available
directly in the reference expression.This change affects the following AST nodes:
MessageReference
now has an optionalattribute
field,FunctionReference
now has a requiredarguments
field,TermReference
now has an optionalattribute
field and an optional
arguments
field.
-
Remove
VariantLists
.The
VariantLists
and theVariantExpression
syntax and AST nodes were
deprecated in Syntax 0.9 and have now been removed. -
Rename
StringLiteral.raw
tovalue
.StringLiteral.value
contains 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
args
toarguments
.The
args
field ofMessageReference
,TermReference
,
FunctionReference
, andAnnotation
has been renamed toarguments
.
Backward-incompatible changes:
VariantLists
are no longer valid syntax. A syntax error is reported
when aVariantList
or aVariantExpression
is found in the parsed file
fluent.syntax 0.13.0
-
Make
BaseNode.equals
stricter when comparing lists.Starting from this version,
BaseNode.equals
now 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
Visitor
APIThe
Visitor
API introduced in 0.11 was changed to align more with
what Python'sast.Visitor
does. 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
,Visitor
andTransformer
.
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.traverse
is deprecated and will be removed in a future
release. Please adjust your code to theVisitor
orTransformer
APIs.
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.
Terms
can 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") }.
VariantLists
are now deprecated and will be removed from the Syntax before version 1.0.All escapes sequences can only be used in
StringLiterals
now (see below).\UHHHHHH
is 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 useStringLiterals
instead, e.g.{"\u00A0"}
. - The closing curly brace character (
}
) is not allowed inTextElements
now. Please useStringLiterals
instead:{"}"}
. StringLiteral.value
was changed to store the unescaped ("cooked") value.StringLiteral.raw
has been added to store the raw value.- The AST of
CallExpressions
was changed to better accommodate the introduction of parameterizedTerms
. TheFunction
AST node has been replaced by theFunctionReference
node. - The leading dash (
-
) is no longer part of theIdentifier
node inTerms
andTermReferences
.