public
Fork of timburks/nu
Description: The Nu programming language.
Homepage: http://programming.nu
Clone URL: git://github.com/patrickt/nu.git
Added comparison to regular expressions.
patrickt (author)
Thu May 29 11:53:41 -0700 2008
commit  8fc05c32464c0965e42a086f4fbf97f2992d0298
tree    1dd9257823c5eafb872817dbd9d30a8fdac539b7
parent  b82c75fe00b214ab8d57fd4e67808e522818ce43
...
380
381
382
 
 
 
 
 
383
384
385
...
380
381
382
383
384
385
386
387
388
389
390
0
@@ -380,6 +380,11 @@ static NuRegex *backrefPattern;
0
 
0
 - (const pcre *)pcre { return regex; }
0
 
0
+- (BOOL)isEqual:(NuRegex *)other
0
+{
0
+ return (([pattern isEqualToString: [other pattern]]) && (options == [other options]));
0
+}
0
+
0
 @end
0
 
0
 @implementation NuRegexMatch
...
44
45
46
47
 
 
 
 
 
 
 
 
48
49
50
...
44
45
46
 
47
48
49
50
51
52
53
54
55
56
57
0
@@ -44,7 +44,14 @@
0
           (assert_equal "c" (match groupAtIndex:1))
0
           (assert_equal "ghi" (match groupAtIndex:2))
0
           (assert_equal "opqrs" (match groupAtIndex:3))
0
- (assert_equal "wxy" (match groupAtIndex:4))))
0
+ (assert_equal "wxy" (match groupAtIndex:4)))
0
+
0
+ (imethod (id) testEquality is
0
+ (assert_equal /hello/ /hello/)
0
+ (assert_equal /extended/x /extended/x)
0
+ (assert_equal /a(.*)z/ /a(.*)z/)
0
+ (assert_not_equal /hello/ /goodbye/)
0
+ (assert_not_equal /extended/x /extended/)))
0
 
0
 
0
 

Comments

    No one has commented yet.