Skip to content

fluent.syntax 0.14.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@stasm stasm released this 26 Mar 14:04

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 a TermReference), all information is available
    directly in the reference expression.

    This change affects the following AST nodes:

    • MessageReference now has an optional attribute field,
    • FunctionReference now has a required arguments field,
    • TermReference now has an optional attribute field and an optional
      arguments field.
  • Remove VariantLists.

    The VariantLists and the VariantExpression syntax and AST nodes were
    deprecated in Syntax 0.9 and have now been removed.

  • Rename StringLiteral.raw to value.

    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 to arguments.

    The args field of MessageReference, TermReference,
    FunctionReference, and Annotation has been renamed to arguments.

Backward-incompatible changes:

  • VariantLists are no longer valid syntax. A syntax error is reported
    when a VariantList or a VariantExpression is found in the parsed file