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

79464 Коммитов

Автор SHA1 Сообщение Дата
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 1c622a6b58 [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
Benoit Daloze 4172036bc6 [ruby/yarp] Do not desugar Foo::Bar {||,&&,+}= baz as it is incorrect without a temporary variable
* See https://github.com/ruby/yarp/pull/1329#discussion_r1310775433 for details.

https://github.com/ruby/yarp/commit/f0fdcba0c3
2023-09-01 13:18:29 +00:00
Benoit Daloze 7fb56df726 [ruby/yarp] Fix comments for methods using desugar_or_write_defined_node
https://github.com/ruby/yarp/commit/a39147736e
2023-09-01 13:18:29 +00:00
Hiroshi SHIBATA 2efd59e2eb [rubygems/rubygems] Use assertion message strictly
https://github.com/rubygems/rubygems/commit/98da5b9826
2023-09-01 07:04:43 +00:00
Nobuyoshi Nakada 4c040fe850
Copy compile options from AST directly without intermediate Hash 2023-09-01 14:06:42 +09:00
Nobuyoshi Nakada 1fbc8cdf06
Copy `rb_compile_option_t` only if needed
Use `COMPILE_OPTION_DEFAULT` if nothing to change.
2023-09-01 13:39:36 +09:00
Nobuyoshi Nakada 61f1657f68
Use macro argument not the variable directly 2023-09-01 13:36:15 +09:00
yui-knk 45cd011d73 [Bug #19281] Allow semicolon in parenthesis at the first argument of command call
Allow compstmt in the first argument of command call wrapped with parenthesis
like following arguments with parenthesis.
2023-09-01 12:55:09 +09:00
Mike Dalessio df4c77608e [ruby/yarp] fix: octal, hex, and unicode strings at the end of a
file
(https://github.com/ruby/yarp/pull/1371)

* refactor: move EOF check into yp_unescape_calculate_difference

parser_lex is a bit more readable when we can rely on that behavior

* fix: octal and hex digits at the end of a file

Previously this resulted in invalid memory access.

* fix: unicode strings at the end of a file

Previously this resulted in invalid memory access.

* Unterminated curly-bracket unicode is a syntax error

https://github.com/ruby/yarp/commit/21cf11acb5
2023-08-31 22:40:35 +00:00
Nobuyoshi Nakada 9930363aab [Bug-18878] Parse qualified const with brace block as method call 2023-09-01 04:26:31 +09:00
Matt Valentine-House 945945dad4 Remove gc_mark_values
Now that gc_mark_values and rb_gc_mark_values are identical, we should
remove one.
2023-08-31 19:31:18 +01:00
Matt Valentine-House 322548180d Prevent rb_gc_mark_values from pinning objects
This is an internal only function not exposed to the C extension API.
It's only use so far is from rb_vm_mark, where it's used to mark the
values in the vm->trap_list.cmd array.

There shouldn't be any reason why these cannot move.

This commit allows them to move by updating their references during the
reference updating step of compaction.

To do this we've introduced another internal function
rb_gc_update_values as a partner to rb_gc_mark_values.

This allows us to refactor rb_gc_mark_values to not pin
2023-08-31 19:31:18 +01:00
Burdette Lamar 84fa8ae84e
[DOC] RDoc for #spawn (#8342) 2023-08-31 14:02:09 -04:00
Nathan Froyd 8470acc1ec [ruby/yarp] add some `const` qualifiers to local variables
https://github.com/ruby/yarp/commit/eb3c6eb928
2023-08-31 17:43:50 +00:00