[whatwg/webidl] Mismatch between normative and informative text about the Other grammar rule (Issue #1100)

There's a note at the bottom of the [IDL grammar](https://webidl.spec.whatwg.org/#idl-grammar) section that says the following:

> Note: The [_Other_](https://webidl.spec.whatwg.org/#prod-Other) non-terminal matches any single terminal symbol except for **(**, **)**, **[**, **]**, **{**, **}** and **,**.

This is false, since one production of that non-terminal is the [**other**](https://webidl.spec.whatwg.org/#prod-other) terminal, defined as `/[^\t\n\r 0-9A-Za-z]/`, which definitely does match those characters. At the same time, the note clearly matches the intended behavior, since allowing _Other_ to match brackets means that finding the end of a set of extended attributes is impossible for a spec-compliant parser.

It looks like nothing besides extended attributes uses the *other* terminal symbol, so my proposed fix is to change its definition to this regular expression:
`/[^\t\n\r 0-9A-Za-z()\[\]{},]/`

I'm sure every existing IDL parser does the right thing in this matter (they'd be utterly broken otherwise), but the specification should also be correct.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/issues/1100
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/webidl/issues/1100@github.com>

Received on Sunday, 13 February 2022 04:00:36 UTC