Skip to content

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

Open
@Pike

Description

@Pike

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions