return StringSupport.codeRangeScan(value.getEncoding(), value) == StringSupport.CR_7BIT;
}
// MRI: reg_fragment_setenc_gen
public void setRegexpEncoding(RegexpNode end, ByteList value) {
RegexpOptions options = end.getOptions();
Encoding optionsEncoding = options.setup19(configuration.getRuntime()) ;
// Change encoding to one specified by regexp options as long as the string is compatible.
if (optionsEncoding != null) {
if (optionsEncoding != value.getEncoding() && !is7BitASCII(value)) {
compileError(optionsEncoding, value.getEncoding());
}
value.setEncoding(optionsEncoding);
} else if (options.isEncodingNone()) {
if (value.getEncoding() == RubyYaccLexer.ASCII8BIT_ENCODING && !is7BitASCII(value)) {
compileError(optionsEncoding, value.getEncoding());
}
value.setEncoding(RubyYaccLexer.ASCII8BIT_ENCODING);
} else if (lexer.getEncoding() == RubyYaccLexer.USASCII_ENCODING) {