ruby/test
NARUSE, Yui ca75332f46 merge revision(s) eccfc978fd: [Backport #19379]
Fix parsing of regexps that toggle extended mode on/off inside regexp

	This was broken in ec3542229b. That commit
	didn't handle cases where extended mode was turned on/off inside the
	regexp.  There are two ways to turn extended mode on/off:

	```
	/(?-x:#y)#z
	/x =~ '#y'

	/(?-x)#y(?x)#z
	/x =~ '#y'
	```

	These can be nested inside the same regexp:

	```
	/(?-x:(?x)#x
	(?-x)#y)#z
	/x =~ '#y'
	```

	As you can probably imagine, this makes handling these regexps
	somewhat complex. Due to the nesting inside portions of regexps,
	the unassign_nonascii function needs to be recursive.  In
	recursive mode, it needs to track both opening and closing
	parentheses, similar to how it already tracked opening and
	closing brackets for character classes.

	When scanning the regexp and coming to `(?` not followed by `#`,
	scan for options, and use `x` and `i` to determine whether to
	turn on or off extended mode.  For `:`, indicting only the
	current regexp section should have the extended mode
	switched, recurse with the extended mode set or unset. For `)`,
	indicating the remainder of the regexp (or current regexp portion
	if already recursing) should turn extended mode on or off, just
	change the extended mode flag and keep scanning.

	While testing this, I noticed that `a`, `d`, and `u` are accepted
	as options, in addition to `i`, `m`, and `x`, but I can't see
	where those options are documented.  I'm not sure whether or not
	handling  `a`, `d`, and `u` as options is a bug.

	Fixes [Bug #19379]
	---
	 re.c                     | 153 +++++++++++++++++++++++++++++++++++++----------
	 test/ruby/test_regexp.rb |  56 +++++++++++++++++
	 2 files changed, 176 insertions(+), 33 deletions(-)
2023-01-31 15:28:01 +09:00
..
-ext- Remove require 'io/wait' where it's no longer necessary. (#6932) 2022-12-15 11:37:01 +13:00
base64
benchmark
bigdecimal [ruby/bigdecimal] Tweak check_rounding_mode_option 2022-11-13 02:02:02 +00:00
cgi [ruby/cgi] Loosen the domain regex to accept '.' 2022-11-28 04:34:11 +00:00
coverage merge revision(s) 2c93c554019ebdc394d3c51c6d925620d3005f84,f5ea43a2e61789357e9c4b374b4bc6756abeae17: [Backport #19360] 2023-01-25 16:34:24 +09:00
csv Reapply the following commits related to extend timeout value. 2022-12-09 16:36:22 +09:00
date [ruby/date] Implement Date#deconstruct_keys and DateTime#deconstruct_keys 2022-12-13 19:52:06 +00:00
did_you_mean [ruby/did_you_mean] Do not suggest #name= for #name and vice versa 2022-12-05 13:16:33 +00:00
digest [ruby/digest] Ignore test_ractor.rb on non-Ractor ruby 2022-07-21 11:45:48 +09:00
drb Do not run drb SSL tests on Windows 2022-12-02 10:49:56 -08:00
dtrace
erb [ruby/erb] Fix line numbers after multi-line <%# 2022-11-29 04:56:03 +00:00
error_highlight [ruby/error_highlight] Enable tests for TypeError and ArgumentError 2022-11-14 06:22:35 +00:00
etc
excludes Now Psych uses the proleptic Gregorian calendar 2022-09-07 10:37:01 +09:00
fiber Ensure Fiber storage is only accessed from the Fiber it belongs to 2022-12-20 19:32:23 +01:00
fiddle Merge fiddle-1.1.1 2022-12-09 16:36:22 +09:00
fileutils [ruby/fileutils] [Feature #18925] Add ln_sr method and relative: option to ln_s 2022-11-25 01:03:57 +00:00
fixtures/fake_sorted_set_gem
io Remove require 'io/wait' where it's no longer necessary. (#6932) 2022-12-15 11:37:01 +13:00
irb [ruby/irb] PTY module is platform dependent 2022-12-19 17:49:59 +09:00
json [flori/json] test parsing of unicode, mixing literal characters with escaped 2022-07-29 19:10:10 +09:00
lib MJIT: Compile methods in batches (#6900) 2022-12-10 22:21:06 -08:00
logger
mkmf Also the tests should use the configured pkg-config 2022-10-02 15:19:14 +09:00
monitor
net Merge net-protocol-0.2.1 2022-12-09 16:36:22 +09:00
nkf
objspace Indicate if a shape is too_complex in ObjectSpace#dump 2022-12-15 13:41:47 -08:00
open-uri Add :ssl_min_version and :ssl_max_version options 2022-10-12 10:36:51 +09:00
openssl [ruby/openssl] test/openssl/test_pkey.rb: allow failures in test_s_generate_parameters 2022-12-23 09:39:15 +09:00
optparse [ruby/optparse] The encoding argument of Regexp.new has been ignored since 1.9 2022-12-21 14:09:12 +09:00
ostruct [ruby/ostruct] Fix class and method as attribute names 2022-03-07 20:08:22 +09:00
pathname [ruby/pathname] Implement Pathname#lutime 2022-04-21 17:10:19 +09:00
psych Always issue deprecation warning when calling Regexp.new with 3rd positional argument 2022-12-22 11:50:26 -08:00
racc [ruby/racc] Make racc test more flexible (for JRuby). 2022-11-10 22:36:34 +00:00
rdoc [ruby/rdoc] Fix fragile tests 2022-12-23 20:31:25 +09:00
readline test_readline#test_without_tty: Use EnvUtil.rubybin 2022-12-21 09:40:09 +09:00
reline [ruby/reline] Fix a misparameter of RubyLex#set_input in 2022-12-14 00:00:39 +00:00
resolv
rinda Skip running a DRb test on MinGW 2022-08-25 11:37:39 -07:00
ripper [Bug #18963] Separate string contents by here document terminator 2022-08-28 09:29:24 +09:00
ruby merge revision(s) eccfc978fd: [Backport #19379] 2023-01-31 15:28:01 +09:00
rubygems Merge the latest stable versions of RubyGems and Bundler to Ruby 3.2.x (#7061) 2023-01-25 23:32:01 +09:00
socket test/socket/test_addrinfo.rb: Suppress Errno::EACCES on Windows 2022-12-21 15:18:34 +09:00
stringio merge revision(s) 21dced8b01: [Backport #19389] 2023-01-31 11:08:50 +09:00
strscan Merge strscan-3.0.5 2022-12-09 16:36:22 +09:00
syslog
uri [ruby/uri] Fix splitting relative URI 2022-10-13 16:24:53 +09:00
win32ole
yaml Relax the timeout of a YAML test 2022-12-01 15:37:41 -08:00
zlib Introduce IO.new(..., path:) and promote File#path to IO#path. (#6867) 2022-12-08 18:19:53 +13:00
runner.rb Use the built bundled gems in test-all as well as test-bundled-gems 2022-12-09 02:20:16 +09:00
test_abbrev.rb
test_delegate.rb [ruby/delegate] Revert "Fix DelegateClass block "method redefined" warning" 2022-12-01 08:08:02 +00:00
test_extlibs.rb dbm and gdbm have been extracted gems. 2022-09-28 17:06:12 +09:00
test_find.rb
test_forwardable.rb
test_getoptlong.rb
test_ipaddr.rb [ruby/ipaddr] Fix exception calling to_range' after freeze' 2022-02-10 17:18:05 +09:00
test_mutex_m.rb
test_observer.rb
test_open3.rb
test_pp.rb [ruby/pp] [Feature #19045] Add support Data#pretty_print 2022-10-14 21:31:24 +09:00
test_prettyprint.rb
test_pstore.rb [ruby/pstore] Emphasize keys instead of roots, values instead of objects (https://github.com/ruby/pstore/pull/7) 2022-07-07 07:05:01 +09:00
test_pty.rb
test_rbconfig.rb
test_securerandom.rb
test_set.rb [ruby/set] Get rid of use of Gem::Version 2022-07-14 17:13:52 +09:00
test_shellwords.rb
test_singleton.rb
test_sorted_set.rb
test_syslog.rb
test_tempfile.rb
test_time.rb
test_timeout.rb [ruby/timeout] Explicit add the timeout thread to default ThreadGroup 2022-09-28 01:59:35 +09:00
test_tmpdir.rb [ruby/tmpdir] Warnings should contain the environment variable name 2022-10-27 03:12:00 +00:00
test_trick.rb test/test_trick.rb: Add tests for TRICK 2022 entries 2022-12-24 03:19:45 +09:00
test_tsort.rb
test_unicode_normalize.rb
test_weakref.rb