chumsky
chumsky copied to clipboard
Allow leading underscores in idents
Summary
_
is not a member of XID_Start
because some languages don't consider it a valid leading character (certain SQL dialects for example). In practice, leading _
's are accepted by most languages and even have a special role in many modern languages where they indicate intentionally ignored variables. Accepting them in ident()
should make it more useful and less surprising.
References
- https://www.unicode.org/reports/tr31/
- https://www.unicode.org/reports/tr31/#NFKC_Modifications