@Specialization public boolean equal(VirtualFrame frame, RubyRange.ObjectRange a, RubyRange.ObjectRange b) { notDesignedForCompilation(); return a.doesExcludeEnd() == b.doesExcludeEnd() && equal(frame, a.getBegin(), b.getBegin()) && equal(frame, a.getEnd(), b.getEnd()); }
@Specialization public boolean include(VirtualFrame frame, RubyRange.ObjectRange range, Object value) { notDesignedForCompilation(); if (callLess.callBoolean(frame, value, "<", null, range.getBegin())) { return false; } if (range.doesExcludeEnd()) { if (callGreaterEqual.callBoolean(frame, value, ">=", null, range.getEnd())) { return false; } } else { if (callGreater.callBoolean(frame, value, ">", null, range.getEnd())) { return false; } } return true; }
@Specialization public Object last(RubyRange.ObjectRange range) { return range.getEnd(); }