This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 28065 - WebIDL: Grammar for readonly requires 2 token lookahead in some cases
Summary: WebIDL: Grammar for readonly requires 2 token lookahead in some cases
Status: RESOLVED WORKSFORME
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: WebIDL (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Cameron McCormack
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-20 20:31 UTC by Kyle Machulis
Modified: 2017-07-31 14:41 UTC (History)
4 users (show)

See Also:


Attachments

Description Kyle Machulis 2015-02-20 20:31:34 UTC
Quoting bz from https://bugzilla.mozilla.org/show_bug.cgi?id=1123516:

So the issue here, as far as I can tell is that when we see the READONLY as our first token it's not clear whether the stack should become "Inherit Readonly" or just "Readonly", right?  In particular, that requires one more token of lookahead: if we're looking at READONLY MAPLIKE then it needs to just become "Readonly" but if we're looking at READONLY ATTRIBUTE it needs to become "Inherit Readonly".
Comment 1 Tobie Langel 2017-07-31 13:47:58 UTC
This seems resolved, no?
Comment 2 Boris Zbarsky 2017-07-31 14:21:22 UTC
Because now ReadOnlyMember and ReadWriteAttribute are separate things under InterfaceMember?

I _think_ so.  It's a bit weird that ReadWriteAttribute includes "inherit ReadOnly AttributeRest" (as in, "ReadWriteAttribute" is a bad name for that production), but I _think_ there's no grammar problem.  I won't know for sure unless/until we try to update our grammar to match the one in the spec right now and see whether the tools complain...
Comment 3 Tobie Langel 2017-07-31 14:27:47 UTC
(In reply to Boris Zbarsky from comment #2)
> Because now ReadOnlyMember and ReadWriteAttribute are separate things under
> InterfaceMember?

Yes? I still find it super hard to reason about this tbh.

> I _think_ so.  It's a bit weird that ReadWriteAttribute includes "inherit
> ReadOnly AttributeRest" (as in, "ReadWriteAttribute" is a bad name for that
> production), but I _think_ there's no grammar problem.

Agree the name is bad. I should probably do a cleanup of the grammar at some point, but I don't think it's a top priority right not.

> I won't know for
> sure unless/until we try to update our grammar to match the one in the spec
> right now and see whether the tools complain...

Sounds good. I'll close this as invalid (not sure what the keyword is for "no longer an issue"). And we can file a new issue if this turns out to be a problem again.