[GH-ISSUE #743] Example for prerelease versions is incorrect according to Backus–Naur Form Grammar #5612

Open
opened 2026-06-15 12:08:01 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @jzangari on GitHub (Aug 17, 2021).
Original GitHub issue: https://github.com/semver/semver/issues/743

9 on the semver.org page states

A pre-release version MAY be denoted by appending a hyphen and a series of dot separated identifiers immediately following the patch version. Identifiers MUST comprise only ASCII alphanumerics and hyphens [0-9A-Za-z-]. Identifiers MUST NOT be empty. Numeric identifiers MUST NOT include leading zeroes. Pre-release versions have a lower precedence than the associated normal version. A pre-release version indicates that the version is unstable and might not satisfy the intended compatibility requirements as denoted by its associated normal version. Examples: 1.0.0-alpha, 1.0.0-alpha.1, 1.0.0-0.3.7, 1.0.0-x.7.z.92, 1.0.0-x-y-z.–.

But the example of

1.0.0-x-y-z.–

does not conform to the Backus-Naur Form Grammar

<valid semver> ::= <version core>
                 | <version core> "-" <pre-release>
                 | <version core> "+" <build>
                 | <version core> "-" <pre-release> "+" <build>

<pre-release> ::= <dot-separated pre-release identifiers>

<dot-separated build identifiers> ::= <build identifier>
                                    | <build identifier> "." <dot-separated build identifiers>

<build identifier> ::= <alphanumeric identifier>
                     | <digits>
Originally created by @jzangari on GitHub (Aug 17, 2021). Original GitHub issue: https://github.com/semver/semver/issues/743 9 on the semver.org page states > A pre-release version MAY be denoted by appending a hyphen and a series of dot separated identifiers immediately following the patch version. Identifiers MUST comprise only ASCII alphanumerics and hyphens [0-9A-Za-z-]. Identifiers MUST NOT be empty. Numeric identifiers MUST NOT include leading zeroes. Pre-release versions have a lower precedence than the associated normal version. A pre-release version indicates that the version is unstable and might not satisfy the intended compatibility requirements as denoted by its associated normal version. Examples: 1.0.0-alpha, 1.0.0-alpha.1, 1.0.0-0.3.7, 1.0.0-x.7.z.92, 1.0.0-x-y-z.–. But the example of > 1.0.0-x-y-z.– does not conform to the Backus-Naur Form Grammar ``` <valid semver> ::= <version core> | <version core> "-" <pre-release> | <version core> "+" <build> | <version core> "-" <pre-release> "+" <build> <pre-release> ::= <dot-separated pre-release identifiers> <dot-separated build identifiers> ::= <build identifier> | <build identifier> "." <dot-separated build identifiers> <build identifier> ::= <alphanumeric identifier> | <digits> ```
Author
Owner

@jwdonahue commented on GitHub (Dec 4, 2021):

See my reply to that original thread. It appears that somebody failed to distinguish between multiple hyphens -- and the long bar character created by some editors when you type two hyphens in a row, which is not a legal SemVer character because it's not ASCII.

<!-- gh-comment-id:986003709 --> @jwdonahue commented on GitHub (Dec 4, 2021): See [my reply](https://github.com/helm/helm/issues/9298#issuecomment-986002946) to that original thread. It appears that somebody failed to distinguish between multiple hyphens `--` and the long bar character `–` created by some editors when you type two hyphens in a row, which is not a legal SemVer character because it's not ASCII.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/semver#5612