Esempio n. 1
0
    @Specialization
    public RubyRegexp initialize(RubyRegexp regexp, RubyString string) {
      notDesignedForCompilation();

      regexp.initialize(this, string.getBytes());
      return regexp;
    }
Esempio n. 2
0
    @Specialization
    public Object match(RubyRegexp regexp, RubyString string) {
      notDesignedForCompilation();

      return regexp.matchCommon(string.getBytes(), true, false)
          != getContext().getCoreLibrary().getNilObject();
    }
Esempio n. 3
0
    @Specialization
    public RubyString escape(RubyString pattern) {
      notDesignedForCompilation();

      return getContext()
          .makeString(
              org.jruby.RubyRegexp.quote19(new ByteList(pattern.getBytes()), true).toString());
    }
Esempio n. 4
0
 @Specialization
 public Object match(RubyRegexp regexp, RubyString string) {
   return regexp.matchCommon(string.getBytes(), false, false);
 }