projectfluent / fluent

Fluent — planning, spec and documentation
https://projectfluent.org
Apache License 2.0
1.42k stars 45 forks source link

Specify behavior of `{$sel->\n*[def]Val}' #285

Open Pike opened 5 years ago

Pike commented 5 years ago

In grammar.js, we have

let SelectExpression = defer(() =>
    sequence(
        InlineExpression.abstract,
        maybe(blank),
        string("->"),
        maybe(blank_inline),
        variant_list.abstract)
    .map(keep_abstract)
    .chain(list_into(FTL.SelectExpression)));

Notably, maybe(blank) between the selector and ->.

For

good = {PLATFORM()->
 *[def] works
}

that's ok, but

bad = {$sel->
 *[def] doesn't
}

is a syntax error, as - is part of the Identifier production.