[BUG] BNF does not match the implementation (original) (raw)

Is there an existing issue for this?

Current Behavior

semver.valid('1.2.3-00') // 'null' semver.valid('1.2.3+00') // '1.2.3'

However, according to the BNF

qualifier  ::= ( '-' pre )? ( '+' build )?
pre        ::= parts
build      ::= parts
parts      ::= part ( '.' part ) *
part       ::= nr | [-0-9A-Za-z]+

pre and build are just the same.

Expected Behavior

The behavior of program is correct, but BNF is not.

We need to update the BNF form.

Steps To Reproduce

No response

Environment