Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typo on the homepage (underscore and dash) #1837

Closed
ShalokShalom opened this issue Mar 6, 2024 · 4 comments · Fixed by #1839
Closed

Typo on the homepage (underscore and dash) #1837

ShalokShalom opened this issue Mar 6, 2024 · 4 comments · Fixed by #1839

Comments

@ShalokShalom
Copy link

ShalokShalom commented Mar 6, 2024

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
Copy link
Member

vkleen commented Mar 6, 2024

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
Copy link
Author

That seems even more confusing to me 🙂

@vkleen
Copy link
Member

vkleen commented Mar 7, 2024

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.

vkleen added a commit that referenced this issue Mar 7, 2024
Explicitly mention the validity of dashes and leading underscores.

Fixes #1837
github-merge-queue bot pushed a commit that referenced this issue Mar 7, 2024
Explicitly mention the validity of dashes and leading underscores.

Fixes #1837
@ShalokShalom
Copy link
Author

Looks much better!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants