Граф коммитов

84968 Коммитов

Автор SHA1 Сообщение Дата
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)

https://github.com/ruby/reline/commit/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)

https://github.com/ruby/reline/commit/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
```
https://rubyci.s3.amazonaws.com/debian12/ruby-master/log/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
https://github.com/flori/json/commit/036944acc6
2024-04-04 12:46:02 +09:00
Hiroshi SHIBATA 514b415d90 [flori/json] Warn to install ostruct if json couldn't load it
https://github.com/flori/json/commit/fff285968d
2024-04-04 12:46:02 +09:00
tompng 066bd28cff [flori/json] Autoload GenericObject to avoid require ostruct warning in Ruby 3.4
https://github.com/flori/json/commit/b507f9e404
2024-04-04 12:46:01 +09:00
Hiroshi SHIBATA 0930231361 [rubygems/rubygems] Allow to use String keys some of configuration
https://github.com/rubygems/rubygems/commit/ee0bef2786
2024-04-04 11:30:02 +09:00
Hiroshi SHIBATA 0be7133b7f [rubygems/rubygems] Re-order configuraiton keys
https://github.com/rubygems/rubygems/commit/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
https://github.com/ruby/prism/commit/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
https://github.com/ruby/prism/commit/85e045ce40
2024-04-03 17:34:12 -04:00
Kevin Newton a64f1ab688 [ruby/prism] Fix up pm_node_list_grow
https://github.com/ruby/prism/commit/7784365d3f
2024-04-03 17:34:12 -04:00
Kevin Newton a33f19f783 [ruby/prism] Allow yields in default values in method definitions
https://github.com/ruby/prism/commit/5bc4cc3413
2024-04-03 17:34:12 -04:00
Kevin Newton bddd004ce9 [ruby/prism] Further delineate block types
https://github.com/ruby/prism/commit/750116e5dc
2024-04-03 17:34:12 -04:00
Kevin Newton e19fccbfdb [ruby/prism] Delineate rescue/else/ensure for more accurate exits
https://github.com/ruby/prism/commit/92868fad78
2024-04-03 17:34:12 -04:00
Kevin Newton be48b733b6 [ruby/prism] Pass block exits up the tree
https://github.com/ruby/prism/commit/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
https://github.com/ruby/prism/commit/5d4da7c69c
2024-04-03 17:34:12 -04:00
Kevin Newton 198d197aeb [ruby/prism] Allow block exits in defined? and fix modifier while/until
https://github.com/ruby/prism/commit/2752f0b8df
2024-04-03 17:34:12 -04:00
Kevin Newton 7ddf093588 [ruby/prism] Allow block exits from while/until/for
https://github.com/ruby/prism/commit/bc46306b9b
2024-04-03 17:34:12 -04:00
Kevin Newton 664a5082cb [ruby/prism] Check for syntax errors using RubyVM
https://github.com/ruby/prism/commit/9e200dd1c1
2024-04-03 17:34:12 -04:00
Kevin Newton 1153bcde6b [ruby/prism] Fix up errors test
https://github.com/ruby/prism/commit/5f86742537
2024-04-03 17:34:12 -04:00
Kevin Newton 8a18a600d6 [ruby/prism] Fix up location tests
https://github.com/ruby/prism/commit/eeef9eb09e
2024-04-03 17:34:12 -04:00
Kevin Newton e454cf2202 [ruby/prism] Update fixtures to be all valid Ruby
https://github.com/ruby/prism/commit/a0b978d25b
2024-04-03 17:34:12 -04:00
Kevin Newton 7d9e5061aa [ruby/prism] Correct errors for invalid retry
https://github.com/ruby/prism/commit/96ca6e51fc
2024-04-03 17:34:12 -04:00
Kevin Newton a83736c27d [ruby/prism] Log errors for invalid jumps
https://github.com/ruby/prism/commit/892d0f9310
2024-04-03 17:34:12 -04:00
Kevin Newton 447d3cca01 [ruby/prism] Update unparser tests
https://github.com/ruby/prism/commit/b70f760b28
2024-04-03 17:34:12 -04:00
Kevin Newton 79c1725096 [ruby/prism] Update seattlerb/ruby_parser tests
https://github.com/ruby/prism/commit/cd823d5026
2024-04-03 17:34:12 -04:00
Kevin Newton 6cd3521519 [ruby/prism] Update whitequark/parser tests
https://github.com/ruby/prism/commit/b1492ec87c
2024-04-03 17:34:12 -04:00
Kevin Newton 08c841ff63 [ruby/prism] Use tilde for extended error lines
https://github.com/ruby/prism/commit/daaa386a4f
2024-04-03 17:34:12 -04:00
Kevin Newton 3147404d64 [ruby/prism] Match circular parameter error message
https://github.com/ruby/prism/commit/c0381b10e4
2024-04-03 17:34:12 -04:00
Maxime Chevalier-Boisvert 571bfc7402
YJIT: update code optimization tips in yjit.md (#10445)
* YJIT: update code optimization tips in yjit.md

* Function => method
2024-04-03 21:28:01 +00:00
Takashi Kokubun c7cda1ae9b
YJIT: Let sp_opnd take the number of slots (#10442) 2024-04-03 15:49:36 -04:00
Kevin Newton f24bf2f9ae Do not rely on ripper for magic comment test 2024-04-03 18:06:20 +00:00
Takashi Kokubun 354e158367
YJIT: Suppress warn(static_mut_refs) (#10440) 2024-04-03 10:38:17 -07:00
Takashi Kokubun 8388604a4c
Revert "Migrate auto_request_review back to CODEOWNERS" (#10441)
Revert "Migrate auto_request_review back to CODEOWNERS (#10133)"

This reverts commit c5b568bab6.
2024-04-03 10:38:00 -07:00
Nobuyoshi Nakada f928e60d41
Check if a fatal signal is from kernel
On Linux, `siginfo_t` uses a union for each `si_code`, and the field
corresponding to `si_pid` does not belong to the `_sigfault` field for
SIGSEGV.  It actually overlaps the `si_addr` field, which is usually
non-zero on stack overflow.

https://github.com/ruby/ruby/pull/10201#issuecomment-2034723244
2024-04-03 23:14:52 +09:00