GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |
GeezerVison is showing github.com — docs: fix BNF grammar to distinguish prerelease from build identifiers by abhu85 · Pull Request #846 · npm/node-semver Conversation
Contributor
SummaryThe BNF grammar in
Current behavior (correctly implemented, but BNF was wrong)semver.valid('1.2.3-00') // null (invalid - prerelease numeric with leading zero) semver.valid('1.2.3+00') // '1.2.3' (valid - build metadata allows any alphanumeric) semver.valid('1.2.3-0') // '1.2.3-0' (valid - single zero is fine) ChangesUpdates the BNF grammar to distinguish between:
Also adds an explanatory note after the BNF block to clarify the distinction. Fixes #665 Test plan
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsThe 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-00` is invalid, `1.2.3-0` is valid) - Build metadata: allows any alphanumeric string including leading zeros (e.g., `1.2.3+00` is 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 <[email protected]>
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
wraithgar
approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Merged
owlstronaut
pushed a commit
that referenced
this pull request
🤖 I have created a release *beep* *boop* --- ## [7.8.0](v7.7.4...v7.8.0) (2026-05-08) ### Features * [`0d0a0a2`](0d0a0a2) [#855](#855) Add `truncate` function (#855) (@pjohnmeyer, @owlstronaut) ### Bug Fixes * [`3905343`](3905343) [#859](#859) Warn when defaulting to --inc=patch in CLI (@pjohnmeyer) ### Documentation * [`c368af6`](c368af6) [#853](#853) fix typos in documentation (#853) (@ankitkumar572005) * [`37776c3`](37776c3) [#846](#846) fix BNF grammar to distinguish prerelease from build identifiers (#846) (@abhu85, @claude) ### Chores * [`9542e09`](9542e09) [#860](#860) template-oss-apply (@owlstronaut) * [`937bc2c`](937bc2c) [#860](#860) `[email protected]` (@owlstronaut) * [`6946fef`](6946fef) [#852](#852) bump @npmcli/template-oss from 4.29.0 to 4.30.0 (#852) (@dependabot[bot], @npm-cli-bot) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This was referenced
This was referenced
This was referenced
5 tasks
This was referenced
This was referenced
This was referenced
This was referenced
This was referenced
6 of 17 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reviewers1 more reviewerUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. [BUG] BNF does not match the implementationUh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |