mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 18:58:30 +00:00
Update semver.er
This commit is contained in:
parent
7e961e37ed
commit
027009680a
1 changed files with 5 additions and 0 deletions
|
@ -38,6 +38,11 @@
|
|||
if self.major == 0, do:
|
||||
self.compatible_with::return self == other
|
||||
self.major == other.major
|
||||
is_valid s: Str =
|
||||
match s.split("."):
|
||||
[major, minor, patch] -> major.isnumeric() and minor.isnumeric() and patch.isnumeric()
|
||||
[major, minor, patch, pre] -> major.isnumeric() and minor.isnumeric() and patch.isnumeric() and pre.isalnum()
|
||||
_ -> False
|
||||
#[
|
||||
greater self, other: .Version =
|
||||
match [self.major > other.major, self.major >= other.major, self.minor > other.minor, self.minor >= other.minor, self.patch > other.patch]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue