Skip to content

Fluent Syntax Spec 0.3.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@stasm stasm released this 18 Oct 10:17
· 207 commits to master since this release
  • Added tags for language-specific grammatical information.

    Tags are binary values attached to messages. They are language-specific and
    can be used to describe grammatical characteristics of the message.

    brand-name = Firefox
        #masculine
    
    brand-name = Aurora
        #feminine
        #vowel
    

    Tags can be used in select expressions by matching a hashtag name to the
    message:

    has-updated = { brand-name ->
            [masculine] …
            [feminine] …
           *[other] …
        }
    

    Tags can only be defined on messages which have a value and don't have any
    attributes.

  • The message body must be indented now.

    Quoted strings are now only valid in placeables and cannot contain other
    placeables. Removed | for multiline blocks.

  • Added TextElement production for text elements of the Pattern.

  • Added annotations and span to all entry types.

    Spans are { start, end } productions. Annotations are { code, args, message, span } productions.

  • Allowed more characters in keys.

    Variant keys are now trimmed from both sides.

    Introduced word which replaces keyword and changes its semantics:
    words cannot contain spaces. Space-separated sequences of words are
    called symbols.

    variant-key may now be a number or a symbol.

    Keyword is now called Symbol in ASDL.

  • Defined the behavior of backslash escapes as follows:

    • Escape sequences are only allowed in text and quoted-text.

    • Newlines are preserved by the parser. This allows proper serialization.

    • Known escape sequences are: \\ for the literal backslash, \" for the
      literal double quote, \{ for the literal opening brace and \u
      followed by 4 hex digits for Unicode code points. Representing code
      points from outside of the Basic Multilingual Plane is made possible with
      surrogate pairs (two \uXXXX sequences). Using the actual character is
      encouraged, however.

    • Any other escaped characters result in a parsing error.

  • Changed the sigil for comments to //.

  • Renamed SelectExpression's expr field to expression.

  • Renamed Junk's and Comments body fields to content.

  • Renamed CallExpression's args field to arguments.

  • Renamed NamedArgument's val field to value.

  • Renamed keyword-argument to named-argument

  • Removed the list data type

    Removed LIST, LEN, TAKE, DROP.