Skip to content

Commit

Permalink
[Truffle] Implemented Regexp.last_match.
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvdrum committed Jan 8, 2015
1 parent 9a05eed commit 2e55827
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 11 additions & 0 deletions core/src/main/ruby/jruby/truffle/core/shims.rb
Expand Up @@ -55,3 +55,14 @@ def each_key
end

end

class Regexp
def self.last_match(n = nil)
if n
# TODO (nirvdrum Jan. 8, 2015) Make sure this supports symbol keys for named capture lookup.
$~.values_at(n).first
else
$~
end
end
end
2 changes: 0 additions & 2 deletions spec/truffle/tags/core/regexp/last_match_tags.txt

This file was deleted.

0 comments on commit 2e55827

Please sign in to comment.