Fluent Syntax Spec 0.6.0
Pre-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 intoJunk
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 theMessage
or theTerm
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. TheCallExpression
'sarguments
field
was replaced by two new fields:positional
andnamed
. -
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 theIdentifier
. -
ExternalArgument
is now calledVariableReference
. -
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 ofMessages
and allAttributes
may only bePatterns
. Values
ofTerms
may either bePatterns
orVariantLists
. Values of
Variants
may only beVariantLists
if they're defined in another
VariantList
. -
SelectExpression
'sexpression
field is now calledselector
. -
StringExpression
is now calledStringLiteral
. -
NumberExpression
is now calledNumberLiteral
. -
TextElement
andPlaceable
are now subclasses of an abstract
PatternElement
class.