tweag / nickel

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

Typo on the homepage (underscore and dash) #1837

Closed ShalokShalom closed 4 months ago

ShalokShalom commented 4 months ago

I quote

Nickel identifiers start with an alphabetic character, followed by zero or more alphanumeric characters, _ (underscores) or ' (single quotes). For example, this-isn't-invalid is a valid identifier.

Underscores are allowed, and you proof that by giving an example with dashes.

I guess either dashes are also ok, and you forgot that to mention, or you made a mistake in that last sentence.

https://nickel-lang.org/user-manual/syntax

vkleen commented 4 months ago

Thanks a lot for reporting this! I agree that this formulation is a bit confusing, I'll see about coming up with a better presentation. For what it's worth, valid identifiers currently need to match the regexp _?[a-zA-Z][_a-zA-Z0-9-']*.

ShalokShalom commented 4 months ago

That seems even more confusing to me 🙂

vkleen commented 4 months ago

The regexp says that identifiers may optionally start with _, but then definitely need an alphabetic character (that is a to z or A to Z) and then may continue with alphabetic characters, digits 0 to 9, underscores, dashes or single quotes.

I'll make a change to the docs and hopefully clarify that.

ShalokShalom commented 4 months ago

Looks much better!