Commit graph

20692 commits

Author SHA1 Message Date
Kevin Newton
debb5e01f1 [ruby/prism] Implement character literals for ripper translation
3c28994a24
2024-03-06 16:42:51 +00:00
Kevin Newton
782f49db5b [ruby/prism] Fix empty strings for ripper translation
836adb0aaa
2024-03-06 16:42:50 +00:00
Kevin Newton
6b76a765ab [ruby/prism] Fix up yield arguments in ripper translation
22b9f3ccd9
2024-03-06 16:42:50 +00:00
Kevin Newton
31ef2f43a7 [ruby/prism] Consolidate semicolon checking in ripper translation
798517da1a
2024-03-06 16:42:50 +00:00
Kevin Newton
de61074514 [ruby/prism] Fix up else in implicit begin for ripper translation
4344b70ed5
2024-03-06 16:42:49 +00:00
Kevin Newton
4ce0395d86 [ruby/prism] Fix up return node for ripper translation
c00902af23
2024-03-06 16:42:49 +00:00
Kevin Newton
7ee404a24a [ruby/prism] Implement special array literals for ripper translation
a5c3d634ef
2024-03-06 16:42:49 +00:00
Kevin Newton
7273c4dd60 [ruby/prism] Fix up lambda ripper translation
a3156e60cc
2024-03-06 16:42:48 +00:00
Kevin Newton
db53705acd [ruby/prism] Implement singleton methods for ripper translation
b7cd5c8e74
2024-03-06 16:42:48 +00:00
Kevin Newton
3a7beffd1b [ruby/prism] Consolidate body node visiting in ripper translation
8feb073fe4
2024-03-06 16:42:48 +00:00
Kevin Newton
8f7db7e64c [ruby/prism] Fix up forwarding arguments for ripper translation
9dbad71aa3
2024-03-06 16:42:47 +00:00
Kevin Newton
e97b364adb [ruby/prism] Unary not for ripper translation
149d01f2c9
2024-03-06 16:42:47 +00:00
Kevin Newton
78fe61c95f [ruby/prism] Implement fields for ripper translation
90f8b33fad
2024-03-06 16:42:47 +00:00
Kevin Newton
c2d6bcc81a [ruby/prism] Revisit call nodes for ripper translation
372200f970
2024-03-06 16:42:46 +00:00
Kevin Newton
a0674a5755 [ruby/prism] Fix implementation of [] and []= for ripper translation
d31cf63d45
2024-03-06 16:42:46 +00:00
Kevin Newton
47daf71ac0 [ruby/prism] Implement super for ripper translation
18dea6ce64
2024-03-06 16:42:45 +00:00
Kevin Newton
53efae0d63 [ruby/prism] Implement other call nodes for ripper translation
a76744be47
2024-03-06 16:42:45 +00:00
Kevin Newton
b0ee9c8f28 [ruby/prism] Implement index nodes for ripper translation
3fd962f2d3
2024-03-06 16:42:45 +00:00
Kevin Newton
7bcca7177d [ruby/prism] Implement hash patterns for ripper translation
6bd7ae2ed2
2024-03-06 16:42:44 +00:00
Kevin Newton
2cb75b8f17 [ruby/prism] Implement multi target nodes for ripper translation
ceb5a5cf62
2024-03-06 16:42:44 +00:00
Kevin Newton
fabece2507 [ruby/prism] Implement lambdas for ripper translation
602d3d2ccb
2024-03-06 16:42:44 +00:00
Kevin Newton
d719814d82 [ruby/prism] Implement target nodes for ripper translation
c5c8299485
2024-03-06 16:42:43 +00:00
Kevin Newton
1d5f05bd53 [ruby/prism] Implement for loop for ripper translation
2d635ce46b
2024-03-06 16:42:43 +00:00
Kevin Newton
17111084d4 [ruby/prism] Implement endless methods for ripper translation
6611820b7b
2024-03-06 16:42:43 +00:00
Kevin Newton
524e93b84e [ruby/prism] Implement find pattern for ripper translation
ef9dca2a4c
2024-03-06 16:42:42 +00:00
Kevin Newton
3bdb0fecd1 [ruby/prism] Implement case/in for ripper translation
7f5a09f40e
2024-03-06 16:42:42 +00:00
Kevin Newton
c4388e8409 [ruby/prism] Add constant path ripper translation
5e47d8eb67
2024-03-06 16:42:42 +00:00
Kevin Newton
c21a50e596 [ruby/prism] Implement def for ripper translation
a3c8c27c20
2024-03-06 16:42:42 +00:00
Kevin Newton
5422b58457 [ruby/prism] Implement if/unless for ripper translation
57c1dd4859
2024-03-06 16:42:41 +00:00
Kevin Newton
d815d68cbb [ruby/prism] Implement regular expressions for ripper translation
788cf7c528
2024-03-06 16:42:41 +00:00
Kevin Newton
bfa2a08444 [ruby/prism] Start tracking failing fixtures in ripper translation
6285e31ccc
2024-03-06 16:42:41 +00:00
Kevin Newton
d56e80f07f [ruby/prism] Reconsolidate ripper files
7a277be5fb
2024-03-06 16:42:36 +00:00
Nobuyoshi Nakada
0c2e976894 [ruby/irb] Clear temporary directories
(https://github.com/ruby/irb/pull/894)

dc0dd25a39
2024-03-06 08:28:16 +00:00
Stan Lo
97d32bb2fc [ruby/irb] Prevent irb_history's creation during HistoryTest
(https://github.com/ruby/irb/pull/893)

Some cases of it currently create `~/.irb_history` files unintentionally
while others don't. This is caused by the varying levels of setup/cleanup between
them. This commit fixes the issue by wrapping every single test inside a
consistent test setup and teardown callbacks.

a2a3cbb0ef
2024-03-06 04:12:49 +00:00
Haroon Ahmed
8f6113a91e [ruby/irb] Add the ability to fetch and load multiple irb files.
(https://github.com/ruby/irb/pull/859)

This allows hierarchy when loading rc files for example both files below
are loaded;

project/.irbrc
~/.irbrc

b53ebc6655

Co-authored-by: Stan Lo <stan001212@gmail.com>
2024-03-05 16:07:45 +00:00
dependabot[bot]
5e5bf57bca [rubygems/rubygems] Bump rb-sys
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.89 to 0.9.90.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.89...v0.9.90)

---
updated-dependencies:
- dependency-name: rb-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

eb93d8b238
2024-03-04 23:59:29 +00:00
Kevin Newton
e78a705f01 [ruby/prism] Warnings for tokens at EOL
d0dbf01bef
2024-03-04 18:09:48 +00:00
Jeremy Evans
5899f6aa55 Keep hidden local variables when dumping and loading iseqs
Fixes [Bug #19975]
2024-03-04 09:49:55 -08:00
Kevin Newton
03a73fdc3d [ruby/prism] Add then keyword loc to when nodes
e1e613df16
2024-03-04 16:40:37 +00:00
Kevin Newton
5856ea3fd1 [ruby/prism] Fix up some minor parser incompatibilities
c6c771d1fa
2024-03-04 14:39:52 +00:00
Nobuyoshi Nakada
b176315827
[Bug #20324] Uncomparable ranges are not overlapping 2024-03-04 21:02:08 +09:00
Yuta Saito
ef5af32799 [rubygems/rubygems] Clear RUBY_CODESIGN env var while running tests
The `RUBY_CODESIGN` environment variable is used by mkmf-generated
Makefile to sign extension bundles on macOS. The variable specifies a
key identifier to use for signing given by the user. However, the key
is usually stored in `$HOME/Library/Keychains` directory, and the test
suite creates a fake `$HOME` directory. This causes the test suite to
try to find the specified key from the fake home directory, which
results in a failure.

ddcfc65bf7
2024-03-04 06:36:29 +00:00
S-H-GAMELINKS
2d8788e90c Support NODE_ONCE for pattern matching 2024-03-04 12:33:00 +09:00
KJ Tsanaktsidis
5621d794a2 Disable callcc when ASAN is enabled
callcc's implementation is fundamentally incompatible with ASAN. Since
callcc is deprecated and almost never used, it's probably OK to disable
callcc when ruby is compiled with ASAN.

[Bug #20273]
2024-03-04 13:07:26 +11:00
Thomas Marshall
7e4b1f8e19
[Bug #20322] Fix rb_enc_interned_str_cstr null encoding
The documentation for `rb_enc_interned_str_cstr` notes that `enc` can be
a null pointer, but this currently causes a segmentation fault when
trying to autoload the encoding. This commit fixes the issue by checking
for NULL before calling `rb_enc_autoload`.
2024-03-03 10:43:35 +00:00
Jeremy Evans
99384bac28 Correctly set anon_kwrest flag for def f(b: 1, **)
In cases where a method accepts both keywords and an anonymous
keyword splat, the method was not marked as taking an anonymous
keyword splat.  Fix that in the compiler.

Doing that broke handling of nil keyword splats in yjit, so
update yjit to handle that.

Add a test to check that calling a method that accepts both
a keyword argument and an anonymous keyword splat does not
modify a passed keyword splat hash.

Move the anon_kwrest check from setup_parameters_complex to
ignore_keyword_hash_p, and only use it if the keyword hash
is already a hash. This should speed things up slightly as
it avoids a check previously used for all callers of
setup_parameters_complex.

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2024-03-01 12:36:19 -08:00
Peter Zhu
6da8f04e01 [ruby/irb] Escape closing square brackets in regexp
Fixes the following warning:

    test/irb/test_command.rb:546: warning: regular expression has ']' without escape

7efadc243b
2024-03-01 19:57:11 +00:00
Takashi Kokubun
661f9e6d03
YJIT: Support opt_invokebuiltin_delegate for leaf builtin (#10152) 2024-03-01 13:03:00 -05:00
Stan Lo
57ca5960ad [ruby/irb] Restructure workspace management
(https://github.com/ruby/irb/pull/888)

* Remove dead irb_level method

* Restructure workspace management

Currently, workspace is an attribute of IRB::Context in most use cases.
But when some workspace commands are used, like `pushws` or `popws`, a
workspace will be created and used along side with the original workspace
attribute.

This complexity is not necessary and will prevent us from expanding
multi-workspace support in the future.

So this commit introduces a @workspace_stack ivar to IRB::Context so IRB
can have a more natural way to manage workspaces.

* Fix pushws without args

* Always display workspace stack after related commands are used

61560b99b3
2024-03-01 15:51:29 +00:00
Jean Boussier
f3af5ae7e6 Make Struct memory leak test faster
[Bug #20311]

It times out on some platform, so we can reduce iterations.
On my machine it completes in 250ms and RSS grows 8X.
2024-03-01 16:33:09 +01:00