docs: fix BNF grammar to distinguish prerelease from build identifiers by abhu85 · Pull Request #846 · npm/node-semver (original) (raw)
The BNF grammar incorrectly showed pre and build as identical rules,
but they have different requirements per SemVer 2.0.0 specification:
- Prerelease identifiers: numeric parts must not have leading zeros
(e.g.,
1.2.3-00is invalid,1.2.3-0is valid) - Build metadata: allows any alphanumeric string including leading zeros
(e.g.,
1.2.3+00is valid)
This updates the BNF in both README.md and range.bnf to correctly reflect the implementation behavior and SemVer spec.
Fixes npm#665
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
abhu85 deleted the fix/bnf-prerelease-build-distinction branch
owlstronaut pushed a commit that referenced this pull request
This was referenced
May 9, 2026
This was referenced
May 16, 2026
This was referenced
May 23, 2026
This was referenced
May 31, 2026
This was referenced
Jun 7, 2026
This was referenced
Jun 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})