RESOLVED FIXED 217667
[WebIDL] Add support for identifiers with dashes ('-')
https://bugs.webkit.org/show_bug.cgi?id=217667
Summary [WebIDL] Add support for identifiers with dashes ('-')
Sam Weinig
Reported 2020-10-13 14:13:29 PDT
[WebIDL] Add support for identifiers with hyphens ('-')
Attachments
Patch (29.97 KB, patch)
2020-10-13 14:40 PDT, Sam Weinig
no flags
Patch (30.27 KB, patch)
2020-10-13 15:09 PDT, Sam Weinig
no flags
Sam Weinig
Comment 1 2020-10-13 14:40:17 PDT
Darin Adler
Comment 2 2020-10-13 15:00:07 PDT
Comment on attachment 411258 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=411258&action=review > Source/WebCore/ChangeLog:12 > + Update identifer regular expression to match current spec which allows for dashes ('-'). identifer > Source/WebCore/ChangeLog:19 > + underscores ('__'), as that is not likely to ever appear in an identifier. C++ reserves identifiers containing double underscores. https://en.cppreference.com/w/cpp/language/identifiers Maybe "_dash_"?
Sam Weinig
Comment 3 2020-10-13 15:07:00 PDT
(In reply to Darin Adler from comment #2) > Comment on attachment 411258 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=411258&action=review > > > Source/WebCore/ChangeLog:12 > > + Update identifer regular expression to match current spec which allows for dashes ('-'). > > identifer > > > Source/WebCore/ChangeLog:19 > > + underscores ('__'), as that is not likely to ever appear in an identifier. > > C++ reserves identifiers containing double underscores. > https://en.cppreference.com/w/cpp/language/identifiers Oh, interesting. I for some reason always thought it was double underscores at the beginning of an identifier, but no, it's anywhere. > > Maybe "_dash_"? That seems good. Will update. Thanks.
Sam Weinig
Comment 4 2020-10-13 15:09:45 PDT
Darin Adler
Comment 5 2020-10-13 15:23:24 PDT
Unicode names the ASCII character "hyphen-minus". So we are being super colloquial calling it a "dash". But that word seems friendly enough.
Sam Weinig
Comment 6 2020-10-13 16:07:33 PDT
(In reply to Darin Adler from comment #5) > Unicode names the ASCII character "hyphen-minus". So we are being super > colloquial calling it a "dash". But that word seems friendly enough. Sorry, a bit unclear here. Are you suggesting I change it from "_dash_" to something else?
Darin Adler
Comment 7 2020-10-13 17:06:42 PDT
No. Just musing on whether this character is a "dash" or a "hyphen", don’t really care which name we chose.
EWS
Comment 8 2020-10-13 17:14:19 PDT
Committed r268435: <https://trac.webkit.org/changeset/268435> All reviewed patches have been landed. Closing bug and clearing flags on attachment 411264 [details].
Radar WebKit Bug Importer
Comment 9 2020-10-13 17:15:26 PDT
Sam Weinig
Comment 10 2020-10-14 09:16:07 PDT
(In reply to Darin Adler from comment #7) > No. Just musing on whether this character is a "dash" or a "hyphen", don’t > really care which name we chose. Heh. I clearly had the same musing as the test case still uses "hyphen" :). I went back and forth a few times.
Note You need to log in before you can comment on or make changes to this bug.