Commit graph

20692 commits

Author SHA1 Message Date
Yusuke Endoh
91b86f1b4f TestRegexp#test_s_timeout: accept timeout errors more tolerantly
This test seems flaky on macOS GitHub Actions
2024-06-07 22:37:08 +09:00
Kevin Newton
40ec860de7 [ruby/error_highlight] Support for the prism compiler
69fbacfd49
2024-06-07 13:15:14 +00:00
Yusuke Endoh
0e5640b56f Extend timeout of TestGCCompect#test_moving_objects_between_size_pools
It is too flaky on macOS GitHub Actions
2024-06-07 22:09:44 +09:00
Nobuyoshi Nakada
9e28354705
ripper: Fix excess compile_error at simple backref op_asgn
Fix up 89cfc15207.
2024-06-07 11:28:38 +09:00
Jeremy Evans
ad29527920 Fix Module#define_method to change visibility when passed existing method body
Fixes [Bug #19749]
2024-06-06 15:02:04 -07:00
Kevin Newton
cbc83c4a92 Remove circular parameter syntax error
https://bugs.ruby-lang.org/issues/20478
2024-06-06 16:29:50 -04:00
Nobuyoshi Nakada
e323dbb1bd
Make subclasses to define methods 2024-06-07 00:50:30 +09:00
Nobuyoshi Nakada
27321290d9 [Bug #20521] ripper: Clean up strterm 2024-06-06 20:43:56 +09:00
tomoya ishida
f465045dd6 [ruby/reline] Remove instance variable @first_char
(https://github.com/ruby/reline/pull/717)

When Reline reads EOF, Reline.readline should return nil if and only if input is empty

cc74b3686a
2024-06-06 11:20:29 +00:00
Baron Bloomer
d4aff75a45 [ruby/logger] Add support for symbols in #shift_age
Resolves issue: https://github.com/ruby/logger/issues/46

83502c2107
2024-06-06 09:07:49 +00:00
Jean Boussier
33f92b3c88 Don't add +YJIT to RUBY_DESCRIPTION until it's actually enabled
If you start Ruby with `--yjit-disable`, the `+YJIT` shouldn't be
added until `RubyVM::YJIT.enable` is actually called. Otherwise
it's confusing in crash reports etc.
2024-06-05 20:53:49 +02:00
Kevin Newton
d13112b779 [ruby/prism] Parse all regular expressions
11e0e204ce
2024-06-05 14:40:03 -04:00
Kevin Newton
3cb866ce35 [ruby/prism] Add Onigmo to other gemfiles
499ec1c3f1
2024-06-05 14:40:03 -04:00
Kevin Newton
2a9c20c317 [ruby/prism] Add Onigmo errors for invalid groups
27e7685dd4
2024-06-05 14:40:03 -04:00
Kevin Newton
0406efaf05 [ruby/prism] Add Onigmo error for invalid repeat and empty group name
953601e3c0
2024-06-05 14:40:03 -04:00
Kevin Newton
d604287626 [ruby/prism] Add Onigmo error for empty char-class
2e02fa3b80
2024-06-05 14:40:03 -04:00
Kevin Newton
c3747d5a2e [ruby/prism] Report onigmo errors for depth
e0e8bba8be
2024-06-05 14:40:03 -04:00
Stan Lo
aa61d4237d [ruby/irb] Add accidentally dropped disable_irb command back
(https://github.com/ruby/irb/pull/964)

* Add accidentally dropped disable_irb command back

* Sort command files require by name

1d627cebca
2024-06-05 16:29:29 +00:00
tomoya ishida
f567633a16 [ruby/reline] Refactor input key reading
(https://github.com/ruby/reline/pull/712)

* Add key binding matching status :matching_matched

* Simplify read_2nd_character

* Add a comment of matching status and EOF

* Matching status to a constant

* Expand complicated ternary operators to case-when

64deec100b
2024-06-05 04:04:09 +00:00
KJ Tsanaktsidis
63e9eaa5be [ruby/openssl] Fix test_create_with_mac_iter accidently setting keytype not maciter
This test was accidentally passing the value 2048 into the keytype
parameter of PKCS12_create, not the mac_iter parameter (because it had
one too many `nil`s in the call). This value is invalid, and will make
OpenSSL perform an out-of-bounds read which is caught when compiling
with ASAN.

This commit fixes the tests, and also adds some validation to
PKCS12.create to make sure any keytype passed is actually valid. Since
there only two valid keytype constants, and the whole feature is an
export-grade crypto era thing only ever supported by old MSIE, it seems
far more likely that code in the whild is using keytype similarly by
mistake rather than as intended. So this validation might catch that.

47028686d2
2024-06-05 00:45:53 +00:00
Kevin Newton
c2fb22d0eb [ruby/prism] (parser) mark spanning newlines as incorrect
09ba678066
2024-06-04 20:28:55 +00:00
Kevin Newton
e440804d7a [ruby/prism] (parser) split up regexp content by lines
85b4a5f804
2024-06-04 20:28:54 +00:00
Kevin Newton
c2d3573c63 [ruby/prism] (parser) handle quoted symbols in hash patterns
461aa5e658
2024-06-04 20:28:54 +00:00
Kevin Newton
f118f92a02 [ruby/prism] (parser) mark unary_num_pow_precedence as incorrect
c49efdf824
2024-06-04 20:28:53 +00:00
Kevin Newton
bbf9b5baad [ruby/prism] (parser) fix up nested multi write
12e079c97e
2024-06-04 20:28:53 +00:00
tomoya ishida
932ecd3a1c [ruby/reline] Ensure no escape sequence before printing prompt
(https://github.com/ruby/reline/pull/716)

f9227b5c89
2024-06-04 18:35:03 +00:00
Takashi Kokubun
5ea843f9b2 Revert "Revert "[ruby/reline] Reline::ANSI is general io. Reline::GeneralIO is not.""
This reverts commit 6e84ac2359.

Now that the rubygems spec change has been merged, let's try reverting
this and fixing it with tompng's new patch.
2024-06-04 11:33:12 -07:00
Kevin Newton
fd517a97be [ruby/prism] Revert "Revert "Properly destructure procarg0 in parser translation""
This reverts commit d8ae19d033.

df1eda2811
2024-06-04 15:05:52 +00:00
Hiroshi SHIBATA
892849ac98 Remove dependency on fiddle from test/ruby
Co-authored-by: "Nobuyoshi Nakada" <nobu@ruby-lang.org>
2024-06-04 19:53:04 +09:00
Takashi Kokubun
6e84ac2359 Revert "[ruby/reline] Reline::ANSI is general io. Reline::GeneralIO is not."
This reverts commit ba01d15cf5.

It seems to be failing test-bundler-parallel. Reverting it to normalize
the CI. We should revert this revert once we figure it out.
2024-06-03 16:11:54 -07:00
Kevin Newton
89ef1392f8 [ruby/prism] Revert "Properly destructure procarg0 in parser translation"
This reverts commit 823e931ff2.

d8ae19d033
2024-06-03 21:31:29 +00:00
Kevin Newton
5502890a2f [ruby/prism] Properly destructure procarg0 in parser translation
823e931ff2
2024-06-03 21:12:36 +00:00
Kevin Newton
56301ba324 [ruby/prism] Update unparser tests
aee84cf42c
2024-06-03 20:57:53 +00:00
Kevin Newton
856898e977 [ruby/prism] Update seattlerb tests
a255653447
2024-06-03 20:57:51 +00:00
Kevin Newton
91ee58ee48 [ruby/prism] Update whitequark tests
95e2484903
2024-06-03 20:57:50 +00:00
tomoya ishida
ba01d15cf5 [ruby/reline] Reline::ANSI is general io. Reline::GeneralIO is not.
(https://github.com/ruby/reline/pull/659)

Reline::ANSI has a partial non-tty supporting code. It should be a general io.
Reline::Dumb should be only used in testing.

2d6828473d
2024-06-03 14:28:33 +00:00
Hiroaki Osawa
5d33ff36dc [ruby/reline] In ed_search_[prev|next]_history, make the cursor come
to the end of the line when there is no search substr
(https://github.com/ruby/reline/pull/714)

* In ed_search_prev_history, make the cursor come to the end of the line when there is no search substr

* In ed_search_next_history, make the cursor come to the end of the line when there is no search substr

* Implemented ActionState to search with empty substr if the previous operation was search with empty string.

* Use a simple 2-element array to represent action_state

95ee80bd70
2024-06-03 14:05:51 +00:00
tomoya ishida
91d4a7ae0c [ruby/reline] Improve key binding match/matching check
(https://github.com/ruby/reline/pull/709)

* Improve key binding match/matching check

* Rename key_actors to default_key_bindings

* Make key_stroke.expand always return a value

* Update add_default_key_binding to use a add_default_key_binding_by_keymap internally

Co-authored-by: Stan Lo <stan001212@gmail.com>

---------

353ec236e2

Co-authored-by: Stan Lo <stan001212@gmail.com>
2024-06-03 13:15:05 +00:00
Jean Boussier
730e3b2ce0 Stop exposing rb_str_chilled_p
[Feature #20205]

Now that chilled strings no longer appear as frozen, there is no
need to offer an API to check for chilled strings.

We however need to change `rb_check_frozen_internal` to no
longer be a macro, as it needs to check for chilled strings.
2024-06-02 13:53:35 +02:00
Nobuyoshi Nakada
05553cf22d
[Bug #20517] Make a multibyte character one token at meta escape 2024-06-01 19:33:12 +09:00
Stan Lo
cda69b5910 [ruby/reline] Overhaul io gate structure
(https://github.com/ruby/reline/pull/666)

* Overhaul IO gate structure

1. Move IO related classes to `lib/reline/io/` directory.
2. Rename `GeneralIO` to `Dumb`.
3. Use IO classes as instances instead of classes.

* Update lib/reline/io/ansi.rb

Co-authored-by: tomoya ishida <tomoyapenguin@gmail.com>

---------

dc1518e1ac

Co-authored-by: tomoya ishida <tomoyapenguin@gmail.com>
2024-06-01 10:28:08 +00:00
akr
3ee83c73c3
Tempfile.create(anonymous: true) implemented. (#10803)
The keyword argument `anonymous` is implemented for `Tempfile.create`

The default is `anonymous: false`.
The behavior is not changed as before.

The created temporary file is immediately removed if `anonymous: true` is specified.
So applications don't need to remove the file.
The actual storage of the file is reclaimed by the OS when the file is closed.

It uses `O_TMPFILE` for Linux 3.11 or later.
It creates an anonymous file from the beginning.

It uses FILE_SHARE_DELETE for Windows.
It makes it possible to remove the opened file.

[Feature #20497]
2024-06-01 15:11:19 +09:00
Kevin Newton
b5c8fb9a3f [ruby/prism] Fix up heredoc location translation for parser
a4e164e22b
2024-05-31 19:31:53 +00:00
Kevin Newton
63ea77916a [ruby/prism] Match % strings in parser
840185110f
2024-05-31 19:31:53 +00:00
Kevin Newton
1b392ba7c6 [ruby/prism] Use correct opening and closing parenthesis for array pattern in parser
beed43922c
2024-05-31 19:31:53 +00:00
Kevin Newton
47f05dffa1 [ruby/prism] Match match_hash_var when quotes are used
f2a327449a
2024-05-31 19:31:52 +00:00
Kevin Newton
02b27aca50 [ruby/prism] Match parser for match_rest in pattern
785de2c39d
2024-05-31 19:31:52 +00:00
David Rodríguez
10c256f98f Sychronize with rubygems/rubygems repo 2024-06-01 01:13:55 +09:00
Jeremy Evans
89486c79bb
Make error messages clear blocks/keywords are disallowed in index assignment
Blocks and keywords are allowed in regular index.

Also update NEWS to make this more clear.

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2024-05-31 08:22:40 -07:00
David Rodriguez
8e2a6435e4 [rubygems/rubygems] Fix gem uninstall warning when two versions of psych installed
1b5644b666
2024-05-31 15:09:37 +00:00