From 9b0a22c999c3c55ec2aca585468d456d1eca2378 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Tue, 20 Dec 2022 12:44:11 -0800 Subject: [PATCH] Always issue deprecation warning when calling Regexp.new with 3rd positional argument Previously, only certain values of the 3rd argument triggered a deprecation warning. First step for fix for bug #18797. Support for the 3rd argument will be removed after the release of Ruby 3.2. Fix minor fallout discovered by the tests. Co-authored-by: Nobuyoshi Nakada --- lib/racc/statetransitiontable.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/racc/statetransitiontable.rb b/lib/racc/statetransitiontable.rb index cae411c9..d75fa165 100644 --- a/lib/racc/statetransitiontable.rb +++ b/lib/racc/statetransitiontable.rb @@ -216,7 +216,7 @@ def mkmapexp(arr) end i = ii end - Regexp.compile(map, nil, 'n') + Regexp.compile(map, Regexp::NOENCODING) end def set_table(entries, dummy, tbl, chk, ptr)