mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-27 19:59:07 +00:00
feat: support refinement class
This commit is contained in:
parent
c72de02c2c
commit
678c02faf9
9 changed files with 94 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue