summaryrefslogtreecommitdiff
path: root/prism_compile.c
diff options
context:
space:
mode:
authorKevin Newton <[email protected]>2024-08-28 16:17:02 -0400
committerKevin Newton <[email protected]>2024-08-29 10:31:02 -0400
commit079161e1ba535da34a4a30179d606390346cdda1 (patch)
treeb85568a492484473c60924cef5424716347bef68 /prism_compile.c
parent14bb376b79ca9140bfd36dbbad06be045f31f92e (diff)
[PRISM] Respect PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING flag
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11482
Diffstat (limited to 'prism_compile.c')
-rw-r--r--prism_compile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/prism_compile.c b/prism_compile.c
index c50f8e1aad..e2f123c810 100644
--- a/prism_compile.c
+++ b/prism_compile.c
@@ -505,7 +505,7 @@ parse_regexp_flags(const pm_node_t *node)
static rb_encoding *
parse_regexp_encoding(const pm_scope_node_t *scope_node, const pm_node_t *node)
{
- if (PM_NODE_FLAG_P(node, PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT)) {
+ if (PM_NODE_FLAG_P(node, PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING) || PM_NODE_FLAG_P(node, PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT)) {
return rb_ascii8bit_encoding();
}
else if (PM_NODE_FLAG_P(node, PM_REGULAR_EXPRESSION_FLAGS_UTF_8)) {