mirror of
https://github.com/semver/semver.git
synced 2026-07-11 06:53:03 -05:00
[GH-ISSUE #583] May prerelease-version contain leading zeros? #2156
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Anaphory on GitHub (Jun 19, 2020).
Original GitHub issue: https://github.com/semver/semver/issues/583
There is some ambiguity in item 9:
The BN grammar says
So this seems to mean “Numeric identifiers MAY be "0", but MUST NOT be any other number with leading zeroes" or something like that? Assuming that is the intention. It would be nice to clarify the natural-language statement in one shape or another, and if that is not the intended meaning, ajdust the examples and the BN grammar.
@steveklabnik commented on GitHub (Jun 19, 2020):
It may be that it's early for me, but I don't see how these conflict?
0is okay, but leading zeroes are not. maybe the ambiguity here is about what "leading" means? I've never heard "0" considered a "leading" zero before.@ljharb commented on GitHub (Jun 19, 2020):
+1, a leading zero is "0" followed by another digit; "0" is not a leading zero.
@Anaphory commented on GitHub (Jun 19, 2020):
I'm not saying they conflict. I'm saying that there might be a phrase that makes it easier for the reader to not stumble over it and get the meaning across that a "0" not followed by any other digit is of course not a leading 0.
@ljharb commented on GitHub (Jun 19, 2020):
I can't come up with any term that would better convey "there must be something after it" than "leading", since that's its literal definition, but i'm sure the maintainers would be happy to change it if a better suggestion materializes :-)
@Vampire commented on GitHub (Jun 21, 2020):
I also agree that a standalone 0 is not a leading 0.
That is common terminology.
A leading 0 is a zero that is added as padding before another number, for example to make numbers equal in character lengths.
@hinell commented on GitHub (Feb 12, 2022):
I'm afraid that BNF is broken.
Contrary to the spec quoted above the following grammar listed in the Semver 2.0 allows leading zeroes.:
To fix that, I would suggest to list it a bit different way: