feat: support refinement class

This commit is contained in:
Shunsuke Shibayama 2023-10-31 02:23:50 +09:00
parent c72de02c2c
commit 678c02faf9
9 changed files with 94 additions and 4 deletions

View file

@ -50,6 +50,9 @@
__eq__ self, other: .SemVer =
self.major == other.major and self.minor == other.minor and self.patch == other.patch and self.pre == other.pre
.SemVerPrefix = Class { "~", "==", "<", ">", "<=", "<=", }
.SemVerSpec = Class { .prefix = .SemVerPrefix; .version = .SemVer }
if! __name__ == "__main__", do!:
v = .SemVer.new(0, 0, 1)
assert v.minor == 0