Commit graph

84976 commits

Author SHA1 Message Date
Kevin Newton
59f931e4f7 [PRISM] Remove dummy_line_node usage for PM_BACK_REFERENCE_READ_NODE 2024-04-04 14:14:55 -04:00
Kevin Newton
6c1cf5232f [PRISM] Remove dummy_line_node usage in pm_interpolated_node_compile 2024-04-04 14:14:55 -04:00
Nobuyoshi Nakada
58918788ab [Bug #20342] Consider wrapped load in main methods 2024-04-05 01:33:08 +09:00
Matt Valentine-House
ef19234b10 Merge rb_objspace_alloc and Init_heap.
Co-Authored-By: Peter Zhu <peter@peterzhu.ca>
2024-04-04 15:00:57 +01:00
Nobuyoshi Nakada
3ac6a03b2e
Revert "hijack SIGCHLD handler for internal use"
This reverts commit 054a412d54.
SIGCHLD `waidpid`, `waitpid_lock` and related code, have been removed
at ruby/ruby#7527.
2024-04-04 21:48:14 +09:00
yui-knk
cfd48adb2f Remove unused function from struct rb_parser_config_struct 2024-04-04 19:13:03 +09:00
Nobuyoshi Nakada
184db1fd6a Update ARGF.write interface 2024-04-04 18:54:54 +09:00
Nobuyoshi Nakada
64b0f4303e Refine test_argf.rb
- Make `make_tempfile` to take data to write, `binmode:` flag, and a
  block.
- Use `make_tempfile` instead of `make_tempfile0`.
- Use `File.binwrite`.
2024-04-04 18:54:54 +09:00
HASUMI Hitoshi
f5e387a300 Separate SCRIPT_LINES__ from ast.c
This patch suggests relocating the code dealing with `SCRIPT_LINES__` from ast.c to ruby_parser.c.

## Background

- I guess `AbstractSyntaxTree.of` method used to use `SCRIPT_LINES__` internally for some reason before
- However, now it appears `SCRIPT_LINES__` is no longer used meaningfully by the method
- As evidence of this, (and as my patch shows,) removing the function call of `rb_script_lines_for()` from `ast_s_of()` does not affect the result of `test/ruby/test_ast.rb`

Given the above, I think two possibilities can be considered:

- (A) `AbstractSyntaxTree.of` has not needed `SCRIPT_LINES__` already (I pick this)
- (B) We lack a test case of `AbstractSyntaxTree.of` that needs to use `SCRIPT_LINES__`

## Besides,

The current implementation causes strange behavior:

```console
ruby -e"SCRIPT_LINES__ = {__FILE__ => []}; puts RubyVM::AbstractSyntaxTree.of(->{ 1 + 2 }, keep_script_lines: true).script_lines"
=> `-e:1:in '<main>': undefined method 'script_lines' for nil (NoMethodError)`
```

I think this is a bug because `AbstractSyntaxTree.of` is not supposed to return `nil` even in this case.
This happens due to the ast.c's dependence on `SCRIPT_LINES__`.
And at the end of the `ast_s_of()`, `node_find()` can not find the target child node obviously because it doesn't make sense to look for a corresponding node made from the parameter of `AbstractSyntaxTree.of` in the AST tree made from the value of `{__FILE__ => []}`

## Solution

Since I think it's good enough `SCRIPT_LINES__` to be only referred by ruby.c, I chose the possibility "(A)" and wrote this patch which moves `rb_script_lines_for()` from ast.c to ruby_parser.c.

So as the result:

- `ast_s_of()` function no longer look up `SCRIPT_LINES__`
- Even so, this patched code passes the existing tests
- The strange behavior above no longer happens (I also added a test for it)

Please correct me if I miss something🙏
2024-04-04 18:29:16 +09:00
Hiroshi SHIBATA
27622f3eb9 [DOC] AppVeyor is already retired 2024-04-04 18:20:13 +09:00
tomoya ishida
8088c88d01
[ruby/reline] Handle INT signal correctly, remove handle_cleared
because clear(C-l) is not a signal
(https://github.com/ruby/reline/pull/646)

3debb0ae2f
2024-04-04 17:18:47 +09:00
tomoya ishida
80e31663f3
[ruby/reline] Fix audoindent including "\v", escape "\v" for
rendering
(https://github.com/ruby/reline/pull/648)

9c51c577ca
2024-04-04 17:18:47 +09:00
Yusuke Endoh
6d82be499b Prevent a warning
```
[19889/25837] TestArgf#test_puts-e:1: warning: ARGF.class#write is outdated interface which accepts just one argument
 = 0.06 s
```
20240404T033003Z.log.html.gz
2024-04-04 14:10:53 +09:00
HASUMI Hitoshi
8aa8fce320 Fix return-type warning in compile.c
This patch surppresses the warning below:

```console
compile.c:10314:1: warning: control reaches end of non-void function [-Wreturn-type]
10314 | }
      | ^
```
2024-04-04 13:38:26 +09:00
Yusuke Endoh
295f2a3305 Prevent a warning: literal string will be frozen in the future 2024-04-04 13:30:27 +09:00
Yusuke Endoh
d910d64ed9 Prevent "method redefined" warnings 2024-04-04 13:29:41 +09:00
Yusuke Endoh
cb30c3d2b3 Prevent "assigned but unused variable" warnings 2024-04-04 13:29:41 +09:00
Yusuke Endoh
fc67091fc8 Prevent "ambiguous first argument" warnings 2024-04-04 13:29:41 +09:00
yui-knk
f057741c5d NODE_LIT is not used anymore 2024-04-04 13:17:26 +09:00
git
bdfbeb90c9 Update default gems list at ab65148c78 [ci skip] 2024-04-04 03:48:12 +00:00
Hiroshi SHIBATA
ab65148c78 [flori/json] Bump up 2.7.2
036944acc6
2024-04-04 12:46:02 +09:00
Hiroshi SHIBATA
514b415d90 [flori/json] Warn to install ostruct if json couldn't load it
fff285968d
2024-04-04 12:46:02 +09:00
tompng
066bd28cff [flori/json] Autoload GenericObject to avoid require ostruct warning in Ruby 3.4
b507f9e404
2024-04-04 12:46:01 +09:00
Hiroshi SHIBATA
0930231361 [rubygems/rubygems] Allow to use String keys some of configuration
ee0bef2786
2024-04-04 11:30:02 +09:00
Hiroshi SHIBATA
0be7133b7f [rubygems/rubygems] Re-order configuraiton keys
b2a88983db
2024-04-04 11:30:01 +09:00
Yusuke Endoh
41e9d6641b Extend timeout of TestRequire#test_require_with_public_method_missing
Launchable reported that this was the most "flaky" test. Perhaps the
default timeout (10 seconds) is too tight for a test that uses
`GC.stress = true`. I try to relax the limit.
2024-04-04 10:30:29 +09:00
yui-knk
6056773105 Move shareable_constant_value logic from parse.y to compile.c 2024-04-04 08:44:10 +09:00
Kevin Newton
4ef99905a6 [PRISM] Enhance syntax error message extraction in test_literal_suffix btest 2024-04-03 17:34:12 -04:00
Kevin Newton
ced6aff206 [PRISM] Mark constant path owning expressions as not popped 2024-04-03 17:34:12 -04:00
Kevin Newton
6bbb3e31fb [ruby/prism] Allow retry in rescue modifier
debe19459a
2024-04-03 17:34:12 -04:00
Kevin Newton
7e28d3c1e3 [PRISM] Enable passing tests for invalid block exits 2024-04-03 17:34:12 -04:00
Kevin Newton
ffba484754 [PRISM] Fix up syntax error message parsing in btests 2024-04-03 17:34:12 -04:00
Kevin Newton
e48fd40974 [ruby/prism] No invalid block exits in eval
85e045ce40
2024-04-03 17:34:12 -04:00
Kevin Newton
a64f1ab688 [ruby/prism] Fix up pm_node_list_grow
7784365d3f
2024-04-03 17:34:12 -04:00
Kevin Newton
a33f19f783 [ruby/prism] Allow yields in default values in method definitions
5bc4cc3413
2024-04-03 17:34:12 -04:00
Kevin Newton
bddd004ce9 [ruby/prism] Further delineate block types
750116e5dc
2024-04-03 17:34:12 -04:00
Kevin Newton
e19fccbfdb [ruby/prism] Delineate rescue/else/ensure for more accurate exits
92868fad78
2024-04-03 17:34:12 -04:00
Kevin Newton
be48b733b6 [ruby/prism] Pass block exits up the tree
168f72b9fe
2024-04-03 17:34:12 -04:00
Kevin Newton
1fb11824f3 [ruby/prism] Introduce PM_NODE_LIST_FOREACH to make it easier to iterate over node lists
5d4da7c69c
2024-04-03 17:34:12 -04:00
Kevin Newton
198d197aeb [ruby/prism] Allow block exits in defined? and fix modifier while/until
2752f0b8df
2024-04-03 17:34:12 -04:00
Kevin Newton
7ddf093588 [ruby/prism] Allow block exits from while/until/for
bc46306b9b
2024-04-03 17:34:12 -04:00
Kevin Newton
664a5082cb [ruby/prism] Check for syntax errors using RubyVM
9e200dd1c1
2024-04-03 17:34:12 -04:00
Kevin Newton
1153bcde6b [ruby/prism] Fix up errors test
5f86742537
2024-04-03 17:34:12 -04:00
Kevin Newton
8a18a600d6 [ruby/prism] Fix up location tests
eeef9eb09e
2024-04-03 17:34:12 -04:00
Kevin Newton
e454cf2202 [ruby/prism] Update fixtures to be all valid Ruby
a0b978d25b
2024-04-03 17:34:12 -04:00
Kevin Newton
7d9e5061aa [ruby/prism] Correct errors for invalid retry
96ca6e51fc
2024-04-03 17:34:12 -04:00
Kevin Newton
a83736c27d [ruby/prism] Log errors for invalid jumps
892d0f9310
2024-04-03 17:34:12 -04:00
Kevin Newton
447d3cca01 [ruby/prism] Update unparser tests
b70f760b28
2024-04-03 17:34:12 -04:00
Kevin Newton
79c1725096 [ruby/prism] Update seattlerb/ruby_parser tests
cd823d5026
2024-04-03 17:34:12 -04:00
Kevin Newton
6cd3521519 [ruby/prism] Update whitequark/parser tests
b1492ec87c
2024-04-03 17:34:12 -04:00