10000 Complex message start syntax is too strict · Issue #610 · unicode-org/message-format-wg · GitHub
[go: up one dir, main page]

Skip to content
Complex message start syntax is too strict #610
Closed
@eemeli

Description

@eemeli

While working on a presentation about the JS implementation, I encountered the following error when testing some of the code I'd written for the slides:

const msg = `
  .local $currency = {EUR}
  .input {$price :number style=currency currency=$currency}
  {{Total price: {$price}}}`;
const mf = new MessageFormat(msg, 'en');
// Syntax parse error: parse-error at [the first { of '{{Total...']

After spending quite a while debugging the implementation code to determine the error here, I came to the conclusion that my parser was correct, the above is indeed a syntax error.

The problem with this message is that the leading whitespace before the first . means that it isn't special, and all of the declaration syntax parses as a valid simple pattern, up until the {{ pattern start.

I mentioned this problem on our Slack channel, where @stasm was also unable to initially see the problem. I think if we can't see it, other developers won't either, and that this will become a significant stumbling block.

We should consider amending the ABNF to allow whitespace before the . at the beginning of a complex message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Seek-Feedback-in-PreviewIssue should be something we seek feedback on in the tech preview periodresolve-candidateThis issue appears to have been answered or resolved, and may be closed soon.syntaxIssues related with syntax or ABNF

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0