public
Description: Reia is a Ruby/Python-like language for BEAM, the Erlang VM
Homepage: http://reia-lang.org
Clone URL: git://github.com/tarcieri/reia.git
Switch Regex pseudo-class to use Erlang re module
Tony Arcieri (author)
Mon Aug 25 00:59:24 -0700 2008
commit  3d95e76adaff52c3294e22fe55c083172ed7227f
tree    9b55f8330063f72dbdf9835322e675c0530ba044
parent  d02155c94cb431b39c23fa816e8bf2a6d71d8da3
...
17
18
19
20
21
22
23
 
 
 
24
25
26
27
28
29
30
...
17
18
19
 
 
 
 
20
21
22
23
24
 
 
 
 
 
0
@@ -17,14 +17,8 @@ module Regex
0
     ["/", regexp.to_string(), "/"].join()
0
   
0
   def funcall(regexp, ~match, [string])
0
- list = string.to_list()
0
- case regexp::match(list, regexp.to_list())
0
- (~match, start, len):
0
- lists::sublist(list, start, len).to_string()
0
+ case re::run(string.to_binary(), regexp.to_list(), [(~capture, ~all, ~binary)])
0
+ (~match, results):
0
+ results.map { |result| result.to_string() }
0
       ~nomatch:
0
         nil
0
-
0
- def funcall(regexp, ~matches, [string])
0
- list = string.to_list()
0
- (~match, matches) = regexp::matches(list, regexp.to_list())
0
- matches.map { |(start, len)| lists::sublist(list, start, len).to_string() }

Comments

    No one has commented yet.