tweag / nickel

Better configuration for less
https://nickel-lang.org/
MIT License
2.23k stars 85 forks source link

[Fix] Allow multiple underscore to start identifiers #1884

Closed yannham closed 2 months ago

yannham commented 2 months ago

Identifiers were required to start with at most one optional underscore, followed by an alphabetic character (to avoid identifiers like _-'), and then by any identifier character. This means that identifiers like __foo were invalid.

There is no good reason for that, and this is mostly an oversight when writing the initial regular expression. This commit extends the lexer to allow zero or more heading underscores before the first alphabetic character.

This came up as I tried to pick ugly, mangled and hopefully non-clashing names for generated Nickel code.