From e5e5970d93f3b823b1f219f36f1be7cd6050637a Mon Sep 17 00:00:00 2001 From: Flaviu Tamas Date: Wed, 4 Mar 2015 21:45:56 -0500 Subject: Fix broken logic in 7296c6d Thanks @fowlmouth for pointing this problem out in IRC. --- src/nre.nim | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/nre.nim') diff --git a/src/nre.nim b/src/nre.nim index dd00cf822..6d6f90046 100644 --- a/src/nre.nim +++ b/src/nre.nim @@ -175,10 +175,12 @@ proc `$`*(pattern: RegexMatch): string = proc `==`*(a, b: Regex): bool = # name-to-number table is generated at init time, doesn't need to be checked - return not a.isNil and not b.isNil and - a.pattern == b.pattern and - a.pcreObj == b.pcreObj and - a.pcreExtra == b.pcreExtra + if not a.isNil and not b.isNil: + return a.pattern == b.pattern and + a.pcreObj == b.pcreObj and + a.pcreExtra == b.pcreExtra + else: + return system.`==`(a, b) proc `==`*(a, b: RegexMatch): bool = # don't need to compare matchbounds, if pattern and str equal, everything -- cgit 1.4.1-2-gfad0