79677 Commits

Author SHA1 Message Date
Hiroshi SHIBATA
923d3517f1 [flori/json] Removed code for Ruby 1.8
https://github.com/flori/json/commit/7f9c29038d
2023-09-05 14:29:46 +09:00
yui-knk
4a90c93427 Pattern matching has not been experimental 2023-09-05 11:52:34 +09:00
Burdette Lamar
c9af911489
[DOC] RDoc for process.c (#8366) 2023-09-04 21:16:48 -04:00
Nobuyoshi Nakada
dab6d55db1 [ruby/rdoc] Remove code for versions older than Ruby 2.6
https://github.com/ruby/rdoc/commit/0d10f460eb
2023-09-05 01:14:52 +00:00
Nobuyoshi Nakada
736092ec11 [ruby/rdoc] Remove code for versions older than Ruby 2.3
https://github.com/ruby/rdoc/commit/a61b777df0
2023-09-05 01:14:51 +00:00
Jeremy Evans
3f6c92e9d5 [ruby/rdoc] Omit descriptions and parameter lists for methods defined in C not mentioned in call-seq
This allows RDoc to better generate documentation for methods
following the Ruby core documentation guide (which omits aliases
in call-seq in most cases).  This makes documentation for methods
defined in C more similar to methods defined in Ruby.  For methods
defined in Ruby, the method description of the aliased method is
already not used (you have to explicitly document the alias to
use it).

Internally, this adds AnyMethod#has_call_seq? and #skip_description?,
and updates Darkfish to:

* only show the method name if there is a call-seq for the method,
  but the call-seq omits the method
* to omit the method description if the method is an alias or has
  aliases and has a call-seq that does not include the method

See discussion in https://github.com/ruby/ruby/pull/7316 for
details.

https://github.com/ruby/rdoc/commit/e3688de49b
2023-09-05 00:45:42 +00:00
theo-squadracer
a14ba622da [ruby/rdoc] handle symbols declared with %s
https://github.com/ruby/rdoc/commit/ed91c4b784
2023-09-05 00:37:30 +00:00
Peter Zhu
db3b814cb0 Add debug info for flaky test_warmup_frees_pages
This test sometimes fails with:

```
  1) Failure:
TestProcess#test_warmup_frees_pages [test/ruby/test_process.rb:2751]:
<0> expected but was
<1>.
```

I'm not sure why, so add some debug info.
2023-09-04 14:01:33 -04:00
Benoit Daloze
0b5c61494e Update to ruby/spec@96d1072 2023-09-04 16:07:46 +02:00
Benoit Daloze
3504f928df Update to ruby/mspec@55d1a62 2023-09-04 16:07:44 +02:00
Yusuke Endoh
4f4c1170bc Revert "Don't reset line coverage for evaled code. (#8330)"
This reverts commit 7e0f5df2f99693267d61636d23da47f79924e9d5.

https://bugs.ruby-lang.org/issues/19857#note-7
2023-09-04 19:52:08 +09:00
Peter Zhu
4cc5659293 Keep write-barrier status after splicing array
We don't need to remove the write-barrier protected status after
splicing an array. We can simply add it to the rememberset for marking
during the next GC.

The benchmark illustrates the performance impact on minor GC:

```
require "benchmark"

arys = 1_000_000.times.map do
  ary = Array.new(50)
  ary.insert(1, 3)
  ary
end

4.times { GC.start }

puts(Benchmark.measure do
  1000.times do
    GC.start(full_mark: false)
  end
end)
```

This branch:

```
  1.309910   0.004342   1.314252 (  1.314580)
```

Master branch:

```
 54.376091   0.219037  54.595128 ( 54.742996)
```
2023-09-04 08:50:27 -04:00
Nobuyoshi Nakada
2ac3e9abe9
[Bug #18487] [DOC] Remove stale note in set_trace_func document
`c-call` and `c-return events no longer pass the nearest Ruby method
binding.
2023-09-04 10:35:26 +09:00
Nobuyoshi Nakada
ba8a7ab8a8
[DOC] Update set_trace_func document
- Clarify the class of event parameters
- Represent event names as strings
- Update the example to show the above
2023-09-04 10:35:26 +09:00
Nobuyoshi Nakada
3b7c8e90da
[DOC] Fix indent of set_trace_func document 2023-09-04 10:35:26 +09:00
Samuel Williams
7e0f5df2f9
Don't reset line coverage for evaled code. (#8330)
* Add failing test.
2023-09-04 13:31:25 +12:00
Burdette Lamar
40ab77eb3d
[DOC] Process doc (#8363) 2023-09-03 15:36:51 -04:00
BurdetteLamar
3602e253e7 [DOC] RDoc for process.c 2023-09-02 19:46:35 -04:00
Herwin
f867e936a9
[DOC] Fix layout in documentation of IO#fcntl 2023-09-03 01:49:40 +09:00
Dorian Marié (perso)
8cd62fbc17
[DOC] Typo in Hash#key description "so/no such value" 2023-09-03 01:47:50 +09:00
Dorian Marié (perso)
3887b45f47
[DOC] FIx typo in description of Hash#hash (regardless or/of order) 2023-09-03 01:46:33 +09:00
Burdette Lamar
ef4dab6983
[DOC] RDoc for process.c (#8358) 2023-09-02 11:43:10 -04:00
Kevin Newton
678112c57c [ruby/yarp] Fix up template reading with LANG=C
https://github.com/ruby/yarp/commit/1ce1817e84
2023-09-02 13:23:21 +00:00
Burdette Lamar
cfcb4a4e26
[DOC] RDoc for process.c (#8353) 2023-09-02 09:04:04 -04:00
Takashi Kokubun
c86497340f [ruby/yarp] Try ignoring $LANG
because the previous commit did not fix it.

https://github.com/ruby/ruby/actions/runs/6054915979/job/16433070185#step:9:155

https://github.com/ruby/yarp/commit/8c9e4c1f15
2023-09-01 23:39:00 +00:00
Takashi Kokubun
3c41ef4749 [ruby/yarp] Support LANG=C environments in template.rb
https://github.com/ruby/yarp/commit/885d731cf5
2023-09-01 23:36:11 +00:00
John Hawthorn
d89b15cdce Use end of char boundary in start_with?
Previously we used the next character following the found prefix to
determine if the match ended on a broken character.

This had caused surprising behaviour when a valid character was followed
by a UTF-8 continuation byte.

This commit changes the behaviour to instead look for the end of the
last character in the prefix.

[Bug #19784]

Co-authored-by: ywenc <ywenc@github.com>
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2023-09-01 16:23:28 -07:00
ywenc
2ca0f01015 Add regression tests for start_with?/delete_prefix 2023-09-01 16:23:28 -07:00
Kevin Newton
e8ef5b1281 [ruby/yarp] Provide a better inspect
https://github.com/ruby/yarp/commit/ef14ae66e4
2023-09-01 16:18:11 -07:00
Takashi Kokubun
00f263e6c4 sync_default_gems.rb: Deal with conflicts on ignored files
that do not exist in the ruby/ruby side.

This resurrects a line that had existed prior to #8329.
2023-09-01 16:17:59 -07:00
Kevin Newton
c666077182 [ruby/yarp] Add global variables to the constant pool
https://github.com/ruby/yarp/commit/b48067b067
2023-09-01 22:52:14 +00:00
Peter Zhu
d1f83c37f8 Try to fix flaky test for Process.warmup
The test sometimes fails with:

```
  1) Failure:
TestProcess#test_warmup_frees_pages [test/ruby/test_process.rb:2749]:
<0> expected but was
<1>.
```

I think there's a page with an object that needs finalization, so run
GC to clear that object.
2023-09-01 17:48:55 -04:00
Jemma Issroff
95308988b6
[YARP] Implement Compiling for And / Or / Operator Write Nodes (#8352) 2023-09-01 14:20:03 -07:00
Kevin Newton
7f9a2df02b [ruby/yarp] Update src/util/yp_string_list.c style
https://github.com/ruby/yarp/commit/e4af2b3bc2
2023-09-01 20:59:40 +00:00
Kevin Newton
d99db1199d [ruby/yarp] Update src/util/yp_newline_list.c style
https://github.com/ruby/yarp/commit/bd7fc2c946
2023-09-01 20:59:40 +00:00
HParker
d617b1b630 [ruby/yarp] remove reallocs preparing for custom memory management
https://github.com/ruby/yarp/commit/bd0b421504
2023-09-01 20:59:39 +00:00
git
570ebeaee2 Update default gems list at 1c622a6b5818a92ba664c3d8292cf0 [ci skip] 2023-09-01 20:57:36 +00:00
Kevin Newton
1c622a6b58 [ruby/yarp] Bump to v0.10.0
https://github.com/ruby/yarp/commit/b6164a76d9
2023-09-01 20:56:15 +00:00
Peter Zhu
95def300d2 Fix flaky test for Process.warmup
The test sometimes fails with:

```
  1) Failure:
TestProcess#test_warmup_run_major_gc_and_compact [test/ruby/test_process.rb:2712]:
<2> expected but was
<3>.
```
2023-09-01 15:28:29 -04:00
Jemma Issroff
e8b646fe91
[YARP] Implement BackReferenceReadNode, NumberedReferenceReadNode (#8344) 2023-09-01 11:30:22 -07:00
Jemma Issroff
c0bf4029e3 [ruby/yarp] Print information about type, flags on AST templated
code
(https://github.com/ruby/yarp/pull/1380)

This commit adds the node type and the node flags as comments to
the AST templated code.

https://github.com/ruby/yarp/commit/f603f2037c
2023-09-01 18:12:55 +00:00
Mike Dalessio
cfe1edddbf [ruby/yarp] fix: report syntax error for invalid hex escape
Closes https://github.com/ruby/yarp/pull/1367

https://github.com/ruby/yarp/commit/b1ab54f526
2023-09-01 17:04:37 +00:00
Mike Dalessio
512f8217cb [ruby/yarp] fix: double-counting of errors in parsing escaped strings
Essentially, this change updates `yp_unescape_calculate_difference` to
not create syntax errors, and we rely entirely on
`yp_unescape_manipulate_string` to report syntax errors.

To do that, this PR adds another (!) parameter to `unescape`:
`yp_list_t *error_list`. When present, `unescape` reports syntax
errors (and otherwise does not).

However, an edge case that needed to be addressed is reporting syntax
errors in this case:

    ?\u{1234 2345}

In a string context, it's possible to have multiple codepoints by
doing something like `"\u{1234 2345}"`; however, in the character
literal context, this is a syntax error -- only a single codepoint is
allowed.

Unfortunately, when `yp_unescape_manipulate_string` is called, there's
nothing to indicate that we are in a "character literal" context and
that only a single codepoint is valid.

To make this work, this PR:

- introduces a new static utility function in yarp.c,
  `yp_char_literal_node_create_and_unescape`, which is called when
  we're parsing `YP_TOKEN_CHARACTER_LITERAL`
- introduces a new (unexported) function,
  `yp_unescape_manipulate_char_literal` which does the same thing as
  `yp_unescape_manipulate_string` but tells `unescape` that only a
  single codepoint is expected

https://github.com/ruby/yarp/commit/f6a65840b5
2023-09-01 17:04:37 +00:00
Peter Zhu
bead539650 Incrementally mark even if we have free pages
We move all pooled pages to free pages at the start of incremental
marking, so we shouldn't run incremental marking only when we have run
out of free pages. This causes incremental marking to always complete
in a single step.
2023-09-01 11:58:50 -04:00
Jemma Issroff
58e0a3699f
Fix YARP compiled send for popping (#8345)
Prior to this commit, we were incorrectly popping callers and receivers
on CallNodes. We shouldn't pop any of these as they might have
side effects.
2023-09-01 08:02:55 -07:00
Jemma Issroff
4f290bc328
[YARP] Small fixes for existing ConstantNodes (#8346)
Popped was slightly inaccurate for ConstantNodes and leading to issues
if there was content after a ConstantNode. This fix doesn't pop
any ConstantWriteNode values.
2023-09-01 08:02:37 -07:00
Peter Zhu
771576f021 Skip weak references to old objects in minor GC
If we are in a minor GC and the object to mark is old, then the old
object should already be marked and cannot be reclaimed in this GC cycle
so we don't need to add it to the weak refences list.
2023-09-01 09:31:59 -04:00
Benoit Daloze
7f6407c356 [ruby/yarp] Ensure node are present only once in the desugared AST
https://github.com/ruby/yarp/commit/7b090bc23d
2023-09-01 13:18:30 +00:00
Benoit Daloze
a21b5a943f [ruby/yarp] Move name_loc before value for LocalVariableWriteNode
* Consistent with ClassVariableWriteNode, ConstantWriteNode, InstanceVariableWriteNode, GlobalVariableWriteNode.
* Fixes desugaring of local variable with operators.

https://github.com/ruby/yarp/commit/9a66737775
2023-09-01 13:18:30 +00:00
Benoit Daloze
f1f6f1b39e [ruby/yarp] Make operator_loc the last field for GlobalVariableWriteNode
* Consistent with ClassVariableWriteNode, ConstantWriteNode, InstanceVariableWriteNode, LocalVariableWriteNode.
* Fixes desugaring of global variable with operators.

https://github.com/ruby/yarp/commit/fb5a53fc0b
2023-09-01 13:18:30 +00:00