Commit graph

18546 commits

Author SHA1 Message Date
Nobuyoshi Nakada
7e51cadc2e Fix method coverage comparisons
Although Ruby's hashes preserve the insertion order, the ordering of
method coverage results is inherently nondeterministic, because they
are collected using `ObjectSpace`.
2023-10-16 09:48:05 +09:00
tomoya ishida
75fb3cf458 [ruby/irb] Restore encoding in InputCompletor test
(https://github.com/ruby/irb/pull/732)

ef77c232cf
2023-10-14 15:02:38 +00:00
Kevin Newton
8e477af1d4 [ruby/prism] Put names on back reference read nodes
10a6403293
2023-10-14 14:15:54 +00:00
tomoya ishida
4e5c505bad [ruby/irb] Restore IRB::InputCompletor for compatibility
(https://github.com/ruby/irb/pull/730)

77265efc5f
2023-10-14 14:12:43 +00:00
Kouhei Yanagita
b28c1d2c56 [Bug #19926] Fix Range#size for ranges with a Rational endpoint 2023-10-14 11:22:42 +09:00
Kevin Newton
11e946da2f [ruby/prism] Fix up PR failings
11255f636e
2023-10-13 15:31:30 -04:00
Kevin Newton
d06523bc52 [ruby/prism] Remove now-defunct semantic_field from nodes
c82a9dad64
2023-10-13 15:31:30 -04:00
Kevin Newton
10e7e5bc8e [ruby/prism] Refactor unescape test to simplify
4392775898
2023-10-13 15:31:30 -04:00
Kevin Newton
37d958eaf4 Remove old unescaping code 2023-10-13 15:31:30 -04:00
Kevin Newton
fa76cddc5b [ruby/prism] Properly handle unescaping in regexp
abf9fd6863
2023-10-13 15:31:30 -04:00
Kevin Newton
e4f1c06a9b [ruby/prism] Use current_string to handle :" symbols
eedeec8f9a
2023-10-13 15:31:30 -04:00
Kevin Newton
a1de762966 [ruby/prism] Use current_string for :' symbols
fadb5be520
2023-10-13 15:31:30 -04:00
Kevin Newton
8bf0d381dc [ruby/prism] Use current_string for %s symbol literals
52504f8911
2023-10-13 15:31:30 -04:00
Kevin Newton
d0614b5254 [ruby/prism] Split up lines in tilde heredocs
21fad0c2ce
2023-10-13 15:31:30 -04:00
Kevin Newton
d6424453db [ruby/prism] Enable remaining heredoc unescape tests
c7ea4941c5
2023-10-13 15:31:30 -04:00
Kevin Newton
24768d8a57 [ruby/prism] Use current_string for escapes in heredocs
fc49acfc59
2023-10-13 15:31:30 -04:00
Kevin Newton
da47a71325 [ruby/prism] Use current_string for x string escape sequences
66ce9280bb
2023-10-13 15:31:30 -04:00
Kevin Newton
ef1e5b65dc [ruby/prism] Use current_string to handle escapes in string literals
d912d48104
2023-10-13 15:31:30 -04:00
Kevin Newton
f64a0434dd [ruby/prism] Use current_string to handle %I
831d5f4b45
2023-10-13 15:31:30 -04:00
Kevin Newton
5fc34f1cde [ruby/prism] Use current_string for handling %W lists
edb1674725
2023-10-13 15:31:30 -04:00
Kevin Newton
3c743445d7 [ruby/prism] Use current_string to handle %i escapes
9c90d0a777
2023-10-13 15:31:30 -04:00
Kevin Newton
4e3013f42d [ruby/prism] Use current_string to handle %w escapes
b8420ea7ae
2023-10-13 15:31:30 -04:00
Kevin Newton
3dba3ab47d [ruby/prism] Strip out old char unescaping
27ca207ab3
2023-10-13 15:31:30 -04:00
Kevin Newton
dd3986876a [ruby/prism] Handle remaining escape sequences for character literals
ba33607034
2023-10-13 15:31:30 -04:00
Kevin Newton
e179e62bd2 [ruby/prism] Skip tests that are currently failing
23b2336148
2023-10-13 15:31:30 -04:00
Kevin Newton
8e223366fc [ruby/prism] More thoroughly test unescapes
e86196dde6
2023-10-13 15:31:30 -04:00
Jemma Issroff
34add1e595
[PRISM] Compile fixes (#8644)
* Fix compiling UndefNodes
* Fix compiling super on ClassNode
* Fix compile popped for ModuleNode
* Add checks for NULL nodes
* Only add newhash if not popped
2023-10-13 10:59:37 -07:00
Takashi Kokubun
5808999d30
YJIT: Fallback opt_getconstant_path for const_missing (#8623)
* YJIT: Fallback opt_getconstant_path for const_missing

* Fix a comment [ci skip]

* Remove a wrapper function
2023-10-13 08:52:23 -07:00
yui-knk
2794a8fef6 [Bug #19919] Warn class variable assignment and constant declaration in condition 2023-10-13 07:35:24 +09:00
Nobuyoshi Nakada
17b0643392
[Bug #19924] Source code should be unsigned char stream
Use `peekc` or `nextc` to fetch the next character, instead of reading
from `lex.pcur` directly, for compilers that plain char is signed.
2023-10-13 02:28:35 +09:00
tomoya ishida
1126bd8c65 [ruby/irb] Fix require path completion disturbing string method
completion
(https://github.com/ruby/irb/pull/726)

e42dc74ce0
2023-10-12 16:54:09 +00:00
Haldun Bayhantopcu
4387af1b4a [ruby/prism] Fix parsing symbols in strings after labels
e16531650d
2023-10-12 16:01:40 +00:00
Matt Valentine-House
5c8764477f [ruby/prism] Increase the depth for the For node index variable
In CRuby's parser locals in for nodes appear deeper in the ast than they
do in Prism, but we can fix that with a transparent scope

460187f41e
2023-10-12 15:26:29 +00:00
tomoya ishida
cf21c72cdb [ruby/irb] Fix test runner exit bug
(https://github.com/ruby/irb/pull/728)

* Remove useless test setup and teardown that sets MAIN_CONTEXT to nil

* Avoid adding command methods to main object in test

f204829a08
2023-10-12 13:55:47 +00:00
tomoya ishida
e029375a7d [ruby/irb] Decouple RubyLex from prompt and line_no
(https://github.com/ruby/irb/pull/701)

* Remove instance variable prompt and line_no from RubyLex

* Fix prompt test

* Rename prompt generating method and make it private

1ceb97fe2e
2023-10-12 12:53:31 +00:00
Kouhei Yanagita
66fabefa03 Add Range#reverse_each implementation for performance 2023-10-12 17:34:49 +09:00
John Hawthorn
635b92099e Fix ObjectSpace.dump with super() callinfo
super() uses 0 as mid for its callinfo, so we need to check for that to
avoid a segfault when using dump_all.
2023-10-12 10:22:32 +02:00
Nobuyoshi Nakada
feac15c1f3 [ruby/securerandom] Extract assert_uuid_v7
029677584d
2023-10-12 05:58:31 +00:00
Koichi Sasada
be1bbd5b7d M:N thread scheduler for Ractors
This patch introduce M:N thread scheduler for Ractor system.

In general, M:N thread scheduler employs N native threads (OS threads)
to manage M user-level threads (Ruby threads in this case).
On the Ruby interpreter, 1 native thread is provided for 1 Ractor
and all Ruby threads are managed by the native thread.

From Ruby 1.9, the interpreter uses 1:1 thread scheduler which means
1 Ruby thread has 1 native thread. M:N scheduler change this strategy.

Because of compatibility issue (and stableness issue of the implementation)
main Ractor doesn't use M:N scheduler on default. On the other words,
threads on the main Ractor will be managed with 1:1 thread scheduler.

There are additional settings by environment variables:

`RUBY_MN_THREADS=1` enables M:N thread scheduler on the main ractor.
Note that non-main ractors use the M:N scheduler without this
configuration. With this configuration, single ractor applications
run threads on M:1 thread scheduler (green threads, user-level threads).

`RUBY_MAX_CPU=n` specifies maximum number of native threads for
M:N scheduler (default: 8).

This patch will be reverted soon if non-easy issues are found.

[Bug #19842]
2023-10-12 14:47:01 +09:00
Ellen Marie Dash
c83f8ad867 [rubygems/rubygems] Simplify logic for Gem::PathSupport#home, and make GEM_HOME always overide it.
64273fd7e3
2023-10-11 19:07:28 +00:00
Ellen Marie Dash
0b9b07a717 [rubygems/rubygems] Allow test_gem_install_update_options to raise Errno::ACCES, in addition to Gem::FilePermissionError.
784fe2a814
2023-10-11 19:07:27 +00:00
Ellen Marie Dash
225c05e3ec [rubygems/rubygems] Update tests to match new implementation of falling back to user-writable directories.
a06e657ac6
2023-10-11 19:07:27 +00:00
Ellen Marie Dash
262f345344 [rubygems/rubygems] [test_gem_install_update_options.rb] Fix linter warnings.
cdcb8394f6
2023-10-11 19:07:26 +00:00
Ellen Marie Dash
7aebe2a52b [rubygems/rubygems] If GEM_HOME exists + isn't writable, use --user-install.
6d20585645
2023-10-11 19:07:26 +00:00
tomoya ishida
94cb5765e2 [ruby/irb] Rename current completor to RegexpCompletor and
refactored for future extension
(https://github.com/ruby/irb/pull/707)

* Move completion implementation to completion/regexp_completor for future extension

* Remove constant CompletionProc and PerfectMatchedProc and add a class method

* Move document display logic to InputCompletor. Each completor only need to implement `completion_caididates` and `doc_namespace`

* Move display_document logic to RelineInputMethod

* Use RegexpCompletor directly. Not through class method of InputCompletor.

* RegexpCompletor extends BaseCompletor, move back definition to completion.rb

* Move display_document test to input_method test

* Stop re-initialize completor on each completion phase

* Store completor to ReadlineInputMethod's iver

1e98521483
2023-10-11 17:09:05 +00:00
Hiroshi SHIBATA
b17ae88894
[flori/json] skip TruffleRuby
bab704eb49
2023-10-11 15:45:17 +09:00
Hiroshi SHIBATA
e42df781d9
[flori/json] define_method is also private at Ruby 2.3 and 2.4
3804f38bf4
2023-10-11 15:45:17 +09:00
Hiroshi SHIBATA
1b19e9198d
[flori/json] remove_method of Module is private at Ruby 2.3 and 2.4
6cbadf6b6e
2023-10-11 15:45:17 +09:00
Hiroshi SHIBATA
40ab7b8c24
Skip test_bug_13526 with High Sierra 2023-10-11 13:46:58 +09:00
Haldun Bayhantopcu
7eccc13c1f [ruby/prism] Emit error when assigning to a numbered parameter
66248ac2f6
2023-10-06 14:10:28 +00:00