Re: [heycam/webidl] Better regular expression for identifiers (#632)

As I said in the comment, that regexp has a concern to accept strange strings as identifiers. From this point of view, "`[_-]?[A-Za-z][0-9A-Z_a-z-]*`" is better, and now I prefer this.

In addition, leading `_` has an important roll in WebIDL spec.

>  the identifier is the value of the identifier token with any leading U+005F LOW LINE ("_") character (underscore) removed.

> If one of these keywords is used, it need not be escaped with a leading underscore.

So if we accept "`__`", should it be treated as "`_`"?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/632#issuecomment-458547761

Received on Tuesday, 29 January 2019 13:54:57 UTC