mirror of
https://github.com/semver/semver.git
synced 2026-07-10 19:50:47 -05:00
[GH-ISSUE #667] Semver 2.0.0 string parser/composer using Prolog's DCG (including unit tests) #7432
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 @dtonhofer on GitHub (Feb 24, 2021).
Original GitHub issue: https://github.com/semver/semver/issues/667
An SWI-Prolog module to
can be found here:
Code and Unit Tests
(Note that github can't syntax-highlight the unit tests file .plt properly, thinking it is gnuplot code. This is why it looks messy.)
This is a simplified version from an overly complex earlier version, somewhat adapted to SWI-Prolog's "codes" approach.
Additionally, for
alphanum_id:And so:
23 test cases to make sure we stay on track
Assemble semver string from elements:
Disassemble semver string into elements:
Bad string doesn't pass the grammar
Also added tests that: