Skip to content

Fluent Syntax Spec 0.6.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@stasm stasm released this 24 Jul 15:30
· 151 commits to master since this release
  • Created the reference parser for Fluent Syntax.

    This version is the first to ship with the official reference
    implementation of the parser. The parser focuses on strictness and
    correctness at a cost of reduced performance.

    The ASDL description of the AST has been removed in favor of
    syntax/ast.mjs which defines the actual AST nodes returned by the
    reference parser.

    The EBNF is now auto-generated from the reference parser's
    syntax/grammar.mjs file. It provides an easy to read overview of the
    grammar and will continue to be updated in the future.

    Going forward, all changes to the grammar will be implemented in the
    reference parser first, which also ships with an extensive test suite.

  • Added junk entries.

    The grammar now explicitly defines the junk_line production which is
    converted into Junk during the AST construction.

  • Comments may now be attached to Messages or Terms.

    The grammar now encodes the behavior for Comments preceding Messages and
    Terms. If there are no blank lines between the Comment and the Message or
    the Term, the Comment becomes part of the Message or the Term AST node.

  • Fixed many issues with the white-space grammar.

    The EBNF for Syntax 0.5 had many issues with its use of inline-space and
    break-indent. It defined undesirable or impossible parsing behavior.
    These issues have been fixed and the new test suite will help ensure the
    correctness of the grammar in the future.

  • Named arguments to CallExpressions must now follow all positional ones.

    The order of arguments to CallExpressions is now strictly defined as
    positional first, named second. The CallExpression's arguments field
    was replaced by two new fields: positional and named.

  • Named arguments to CallExpressions must now be unique.

  • Added the TermReference expression.

    References to terms used to be stored as MessageReferences in the AST.
    They now have their own expression type.

  • Store the referent expression in attribute and variant expressions.

    MessageAttributeExpression, TermAttributeExpression and
    TermVariantExpression now store the entire referent expression in a new
    ref field, rather than just the Identifier.

  • ExternalArgument is now called VariableReference.

  • Add the VariantList value type.

    Selector-less SelectExpressions have been removed in favor of
    VariantLists which share the same syntax but have more restricted usage.
    Values of Messages and all Attributes may only be Patterns. Values
    of Terms may either be Patterns or VariantLists. Values of
    Variants may only be VariantLists if they're defined in another
    VariantList.

  • SelectExpression's expression field is now called selector.

  • StringExpression is now called StringLiteral.

  • NumberExpression is now called NumberLiteral.

  • TextElement and Placeable are now subclasses of an abstract
    PatternElement class.