Skip to content

Commit

Permalink
Update semver.er
Browse files Browse the repository at this point in the history
  • Loading branch information
mtshiba committed Oct 16, 2023
1 parent 9389ba3 commit 55f24ae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/erg_compiler/lib/std/semver.er
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
assert num_ in Nat
.Identifier::__new__ { .name; .num = num_ }
_ -> panic "invalid identifier string: \{s}"
@Override
__repr__ ref self = "Identifier(\{self.name}.\{self.num})"

.SemVer = Class { .major = Nat; .minor = Nat; .patch = Nat; .pre = .Identifier or NoneType }
.SemVer|<: Show|.
Expand All @@ -30,6 +32,8 @@
[major, minor, patch, pre] ->
.SemVer.new(nat(major), nat(minor), nat(patch), .Identifier.from_str(pre))
_ -> panic "invalid semver string: \{s}"
@Override
__repr__ ref self = self.__str__()
#[
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]:
Expand Down

0 comments on commit 55f24ae

Please sign in to comment.