New issue
Advanced search Search tips

Issue 820353 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 781257



Sign in to add a comment

IDL parser: IDL parser need to accept a keyword token as an identifier

Project Member Reported by peria@chromium.org, Mar 9 2018

Issue description

Web IDL spec says;

 The identifier of any of the abovementioned IDL constructs must not be "constructor", "toString", or begin with a U+005F LOW LINE ("_") character. These are known as reserved identifiers.

and "The identifier of any of the abovementioned IDL constructs" figures most identifiers.
https://heycam.github.io/webidl/#idl-names

However, current implementation of idl_parser.py does not take those keywords as identifiers, and fails to match patterns.

As a result, at the moment, we can't introduce 'includes' keyword beause of includes operation in IDBKeyRange.idl.
https://cs.chromium.org/search/?q=includes%5C(+file:%5C.idl$&type=cs
 

Comment 1 by peria@chromium.org, Mar 9 2018

Hmm, idl_lexer seems to have a hack to put a leading '_' to avoid such a confusion.
https://cs.chromium.org/chromium/src/tools/idl_parser/idl_lexer.py?q=idl_lexer&l=169-172

Comment 2 by jsb...@chromium.org, Mar 12 2018

The IndexedDB spec itself now has _ because 'includes' on its own is not valid at the spec level. In IDL, an identifier token has its leading _ stripped to become the identifier: "For all of these constructs, the identifier is the value of the identifier token with any leading U+005F LOW LINE ("_") character (underscore) removed." 

For context on the IDB side:

https://github.com/w3c/IndexedDB/commit/98b28b9890eb92b36eaadbedb31cea2d3bcd64aa
https://github.com/w3c/IndexedDB/issues/229

Comment 3 by peria@chromium.org, Mar 13 2018

Status: WontFix (was: Available)
Ah, I wasn't aware of the note.
Thank you for letting us know it.
Project Member

Comment 4 by bugdroid1@chromium.org, Jun 8 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/37e2e88d9390b99f8271c05c59c10e26acfeb3f8

commit 37e2e88d9390b99f8271c05c59c10e26acfeb3f8
Author: Hitoshi Yoshida <peria@chromium.org>
Date: Fri Jun 08 08:19:53 2018

idl: Remove comment about _ in idl identifier

The way to handle '_' in identifier is described Web IDL spec.
We don't need a confusing comment as if it comes from our IDL compiler implementation.
https://heycam.github.io/webidl/#idl-names


Bug:  820353 
Change-Id: Iba6c851daa6ae0dc6d690b220a5c757d507e4dc7
Reviewed-on: https://chromium-review.googlesource.com/1092217
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Kenichi Ishibashi <bashi@chromium.org>
Commit-Queue: Hitoshi Yoshida <peria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565588}
[modify] https://crrev.com/37e2e88d9390b99f8271c05c59c10e26acfeb3f8/third_party/blink/renderer/modules/indexeddb/idb_key_range.idl
[modify] https://crrev.com/37e2e88d9390b99f8271c05c59c10e26acfeb3f8/tools/idl_parser/test_parser/interface_web.idl

Sign in to add a comment