We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a1570b commit de7d101Copy full SHA for de7d101
src/docopt.nim
@@ -96,8 +96,14 @@ method name(self: Pattern): string {.base, gcsafe.} =
96
method `name=`(self: Pattern, name: string) {.base, gcsafe.} =
97
self.m_name = name
98
99
-method `==`(self, other: Pattern): bool {.base, gcsafe, nosideeffect.} =
100
- self.str == other.str
+proc `==`(self, other: Pattern): bool =
+ if self.is_nil and other.is_nil:
101
+ true
102
+ elif not self.is_nil and not other.is_nil:
103
+ self.str == other.str
104
+ else:
105
+ # Exactly one of the two is nil
106
+ false
107
108
method flat(self: Pattern,
109
types: varargs[string]): seq[Pattern] {.base, gcsafe.} =
0 commit comments