@@ -2393,8 +2393,8 @@ public RubyNode visitInterpolatedRegularExpressionNode(Nodes.InterpolatedRegular
2393
2393
if (!options .isKcodeDefault ()) { // explicit encoding
2394
2394
encoding = encodingAndOptions .encoding ;
2395
2395
} else {
2396
- // use BINARY explicitly probably because forcing encoding isn't implemented yet in Prism
2397
- // see https://github.com/ruby/prism/issues/1997
2396
+ // Use BINARY explicitly probably because forcing encoding isn't implemented yet in Prism
2397
+ // Needed until https://github.com/ruby/prism/issues/2620 is fixed
2398
2398
// The logic comes from ParserSupport#createMaster
2399
2399
encoding = Encodings .BINARY ;
2400
2400
}
@@ -3008,7 +3008,7 @@ public RubyNode visitRegularExpressionNode(Nodes.RegularExpressionNode node) {
3008
3008
3009
3009
final RubyRegexp regexp ;
3010
3010
try {
3011
- // Needed until https://github.com/ruby/prism/issues/1997 is fixed
3011
+ // Needed until https://github.com/ruby/prism/issues/2620 is fixed
3012
3012
sourceWithEnc = ClassicRegexp .setRegexpEncoding (sourceWithEnc , options , sourceEncoding , currentNode );
3013
3013
3014
3014
regexp = RubyRegexp .create (language , sourceWithEnc .tstring , sourceWithEnc .encoding ,
@@ -3058,15 +3058,16 @@ private RegexpEncodingAndOptions getRegexpEncodingAndOptions(Nodes.RegularExpres
3058
3058
explicitEncoding = false ;
3059
3059
}
3060
3060
3061
- if (!explicitEncoding ) {
3062
- if (flags .isForcedBinaryEncoding ()) {
3063
- regexpEncoding = Encodings .BINARY ;
3064
- } else if (flags .isForcedUsAsciiEncoding ()) {
3065
- regexpEncoding = Encodings .US_ASCII ;
3066
- } else if (flags .isForcedUtf8Encoding ()) {
3067
- regexpEncoding = Encodings .UTF_8 ;
3068
- }
3069
- }
3061
+ // Don't check forced encoding flags until https://github.com/ruby/prism/issues/2620 is fixed
3062
+ // if (!explicitEncoding) {
3063
+ // if (flags.isForcedBinaryEncoding()) {
3064
+ // regexpEncoding = Encodings.BINARY;
3065
+ // } else if (flags.isForcedUsAsciiEncoding()) {
3066
+ // regexpEncoding = Encodings.US_ASCII;
3067
+ // } else if (flags.isForcedUtf8Encoding()) {
3068
+ // regexpEncoding = Encodings.UTF_8;
3069
+ // }
3070
+ // }
3070
3071
3071
3072
final RegexpOptions options = new RegexpOptions (kcode , fixed , flags .isOnce (), flags .isExtended (),
3072
3073
flags .isMultiLine (), flags .isIgnoreCase (), flags .isAscii8bit (), !explicitEncoding , true );
0 commit comments