Skip to content
Permalink
Browse files

Merge pull request #788 from kostya/regx1

fix regexp eql
  • Loading branch information
alex committed Jul 7, 2013
2 parents ba97812 + fcd34ea commit 4108429e10c456a81b819a277c8269fde370f94d

This file was deleted.

This file was deleted.

@@ -1,8 +1,2 @@
fails:Regexp#fixed_encoding? returns false by default
fails:Regexp#fixed_encoding? returns false if the 'n' modifier was supplied to the Regexp
fails:Regexp#fixed_encoding? returns true if the 'u' modifier was supplied to the Regexp
fails:Regexp#fixed_encoding? returns true if the 's' modifier was supplied to the Regexp
fails:Regexp#fixed_encoding? returns true if the 'e' modifier was supplied to the Regexp
fails:Regexp#fixed_encoding? returns true if the Regexp contains a \u escape
fails:Regexp#fixed_encoding? returns true if the Regexp contains a UTF-8 literal
fails:Regexp#fixed_encoding? returns true if the Regexp was created with the Regexp::FIXEDENCODING option
@@ -197,7 +197,7 @@ def method_equal(self, space, w_other):
return space.w_false
self._check_initialized(space)
w_other._check_initialized(space)
return space.newbool(self.source == w_other.source)
return space.newbool(self.source == w_other.source and (self.flags | regexp.NO_ENCODING) == (w_other.flags | regexp.NO_ENCODING))

@classdef.method("source")
def method_source(self, space):
@@ -253,6 +253,10 @@ def method_escape(self, space, string):
def method_options(self, space):
return space.newint(self.flags)

@classdef.method("fixed_encoding?")
def method_fixed_encodingp(self, space):
return space.newbool(bool(self.flags & regexp.FIXED_ENCODING))


class W_MatchDataObject(W_Object):
classdef = ClassDef("MatchData", W_Object.classdef)

0 comments on commit 4108429

Please sign in to comment.
You can’t perform that action at this time.