From 55f24ae5a6b6c364d23d47f2ac4efcbb751c7c0e Mon Sep 17 00:00:00 2001 From: Shunsuke Shibayama Date: Mon, 16 Oct 2023 11:40:02 +0900 Subject: [PATCH] Update semver.er --- crates/erg_compiler/lib/std/semver.er | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/erg_compiler/lib/std/semver.er b/crates/erg_compiler/lib/std/semver.er index a3a815a8f..332a50d82 100644 --- a/crates/erg_compiler/lib/std/semver.er +++ b/crates/erg_compiler/lib/std/semver.er @@ -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|. @@ -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]: