Skip to content

fluent 0.10.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@stasm stasm released this 13 Dec 15:57

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 in TextElements. It's no longer possible to use escape sequences in TextElements. Please use StringLiterals instead, e.g. {"\u00A0"}.
  • The closing curly brace character (}) is not allowed in TextElements now. Please use StringLiterals 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 parameterized Terms. The Function AST node has been replaced by the FunctionReference node.
  • The leading dash (-) is no longer part of the Identifier node in Terms and TermReferences.