Implement relational operators on Basic_version class; Improve documentation; Fix bug in parser regarding prerelease token treatment on transition between prerelease and build parsing; Add unit tests for missing cases
This commit is contained in:
+1
-1
@@ -3,5 +3,5 @@ include_directories(
|
||||
)
|
||||
|
||||
add_library(semver
|
||||
Semver200_parser.cpp Semver200_comparator.cpp
|
||||
Semver200_comparator.cpp Semver200_parser.cpp
|
||||
)
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace {
|
||||
|
||||
namespace version {
|
||||
|
||||
int Semver200_comparator::compare(const Version_data& l, const Version_data& r) {
|
||||
int Semver200_comparator::compare(const Version_data& l, const Version_data& r) const {
|
||||
int cmp = compare_normal(l, r);
|
||||
if (cmp != 0) return cmp;
|
||||
|
||||
|
||||
@@ -44,9 +44,9 @@ namespace {
|
||||
const vector<Transition>& transitions, string& target, Validator validate) {
|
||||
for (const auto& t : transitions) {
|
||||
if (c == get<0>(t)) {
|
||||
if (get<2>(t)) get<2>(t)(target);
|
||||
prev_phase = phase;
|
||||
phase = get<1>(t);
|
||||
if (get<2>(t)) get<2>(t)(target);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -76,7 +76,7 @@ namespace {
|
||||
|
||||
namespace version {
|
||||
|
||||
Version_data Semver200_parser::parse(const string& s) {
|
||||
Version_data Semver200_parser::parse(const string& s) const {
|
||||
string major;
|
||||
string minor;
|
||||
string patch;
|
||||
|
||||
Reference in New Issue
Block a user