79156 Commits

Author SHA1 Message Date
Kevin Newton
ca9a44795b Remove version templating in YARP 2023-08-25 18:20:51 -04:00
Kevin Newton
aea7e91828 Fix sync script for YARP 2023-08-25 18:20:51 -04:00
Samuel Williams
b2d1c720ec
Add documentation regarding how to build Ruby for debugging. (#8290)
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2023-08-26 09:59:45 +12:00
Kevin Newton
439f069b4b [ruby/yarp] Move tests from test/* to test/yarp/* to match CRuby
This should make it easier on the sync to determine what changed
and hopefully result in fewer merge conflicts that have to be
manually resolved.

https://github.com/ruby/yarp/commit/17d82afbfc
2023-08-25 21:15:49 +00:00
Kevin Newton
9b8602dd90 [ruby/yarp] Introduce parse_lex instead of asking for a block
https://github.com/ruby/yarp/commit/7e70339fe1
2023-08-25 21:10:19 +00:00
Kevin Newton
76512d78fc [ruby/yarp] Rename Location#to to Location#join, include checks
https://github.com/ruby/yarp/commit/de8924e3ec
2023-08-25 21:10:17 +00:00
Kevin Newton
4813887694 [ruby/yarp] Accept a block to parse and parse_file to get lexer output as well
https://github.com/ruby/yarp/commit/40fbf61a8d
2023-08-25 21:10:17 +00:00
Kevin Newton
0c1a749eef [ruby/yarp] Fix nested multi assignment locations
https://github.com/ruby/yarp/commit/9a65f002dc
2023-08-25 21:10:16 +00:00
Kevin Newton
20cf9e3ae8 [ruby/yarp] Add a Location#to method for combining them
https://github.com/ruby/yarp/commit/1db2de98ac
2023-08-25 21:10:15 +00:00
Kevin Newton
55a8add304 [ruby/yarp] Fix rational parsing
https://github.com/ruby/yarp/commit/c8f31eb5b6
2023-08-25 21:10:15 +00:00
Kevin Newton
a31b069a8a [ruby/yarp] Track block opening and closing locations
https://github.com/ruby/yarp/commit/7984e4ddc7
2023-08-25 21:10:13 +00:00
Kevin Newton
b9a2c96747 [ruby/yarp] Ensure interpolated symbols converted to regular symbols get opening and closing
https://github.com/ruby/yarp/commit/386655d54f
2023-08-25 21:10:13 +00:00
Kevin Newton
b112e89bb1 [ruby/yarp] Add closing_loc to WhileNode
https://github.com/ruby/yarp/commit/b4132b876d
2023-08-25 21:10:12 +00:00
Kevin Newton
df11a08d93 [ruby/yarp] Add closing_loc to UntilNode
https://github.com/ruby/yarp/commit/4362cecc2c
2023-08-25 21:10:11 +00:00
Kevin Newton
74780c3e7f [ruby/yarp] Call shorthand should not result in a message location
https://github.com/ruby/yarp/commit/ad0f9d35e3
2023-08-25 21:10:10 +00:00
Kevin Newton
85c8e8b9bd
Fix VPATH for yarp/version.h 2023-08-25 15:53:01 -04:00
Kevin Newton
934552618e [ruby/yarp] Fix relative require for version in YARP gemspec
https://github.com/ruby/yarp/commit/ca8e8cfa0d
2023-08-25 19:48:51 +00:00
Kevin Newton
a7c7cd11bc
Update sync script to handle yarp/version.h 2023-08-25 15:47:25 -04:00
Kevin Newton
2e29bd6ce0 [ruby/yarp] Use .rb suffix to find version file
https://github.com/ruby/yarp/commit/7c530c79c2
2023-08-25 19:43:49 +00:00
Kevin Newton
d2392e1ce2 [ruby/yarp] Fix relative require in template script
https://github.com/ruby/yarp/commit/dea9eb5a12
2023-08-25 19:43:10 +00:00
Benoit Daloze
f603497105 [ruby/yarp] Use templating to avoid duplicating the YARP version in many places
https://github.com/ruby/yarp/commit/9c359fd92e
2023-08-25 19:37:17 +00:00
Kevin Newton
dd07b70253
Fix mutation visitor build for YARP templating 2023-08-25 15:33:14 -04:00
Kevin Newton
0df515c095 [ruby/yarp] Mark local variable targets in pattern matching
https://github.com/ruby/yarp/commit/6c6700a001
2023-08-25 19:31:33 +00:00
Kevin Newton
7898b8e1ea [ruby/yarp] Provide target node versions
https://github.com/ruby/yarp/commit/a026564d38
2023-08-25 19:31:31 +00:00
Kevin Newton
aeef709109 [ruby/yarp] Split up parse_target and parse_write
https://github.com/ruby/yarp/commit/75d8bb93ea
2023-08-25 19:31:31 +00:00
Kevin Newton
2ebaf077f6 [ruby/yarp] Provide a desugar visitor
https://github.com/ruby/yarp/commit/9fad513089
2023-08-25 19:31:30 +00:00
Kevin Newton
a38ca45b65 [ruby/yarp] Split up AndWriteNode, OrWriteNode, OperatorWriteNode
https://github.com/ruby/yarp/commit/6d3b3b5776
2023-08-25 19:31:28 +00:00
Kevin Newton
649aba28f4 [ruby/yarp] Add Node#copy and MutationVisitor
https://github.com/ruby/yarp/commit/3693091661
2023-08-25 19:31:28 +00:00
Kevin Newton
3b9085ad24 [ruby/yarp] Lambda params should not accept blocks
https://github.com/ruby/yarp/commit/706daae0ac
2023-08-25 19:11:24 +00:00
HParker
f84690c6e2 [ruby/yarp] ignore state on embexpr_end
Ripper state can carry over from the previous node type making coparison less useful

https://github.com/ruby/yarp/commit/74509728d4
2023-08-25 19:11:14 +00:00
Takashi Kokubun
4825600da5 Update NEWS.md for YJIT [ci skip]
Reverse-merge Maxime's release notes changes to NEWS.md and added a
couple of things that are not in release notes.
2023-08-25 12:00:54 -07:00
Mike Dalessio
3525c460f9 [ruby/yarp] fix: regexes and strings with escaped newline around a heredoc
Found via the fuzzer.

https://github.com/ruby/yarp/commit/501757135a

Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2023-08-25 18:20:49 +00:00
Jemma Issroff
bf3d48e182 [ruby/yarp] Allow whitespace after "(en)coding" before ":", as in "encoding :"
https://github.com/ruby/yarp/commit/d39a998182
2023-08-25 18:19:08 +00:00
Nobuyoshi Nakada
7d32011399 [Bug #19852] Use gem name without suffix 2023-08-26 02:47:04 +09:00
Nobuyoshi Nakada
40efbc7e40 [Bug #19851] Ripper: Hide internal block argument ID 2023-08-26 02:08:53 +09:00
Kevin Newton
61c5c2f1c8 [ruby/yarp] Add names to classes and modules
This should hopefully make it easier to compile these nodes, and
also for static analysis tools for having a quick label.

https://github.com/ruby/yarp/commit/f086662144
2023-08-25 17:02:38 +00:00
Nobuyoshi Nakada
fe73f9f24b
Replace only use of snprintf in parser 2023-08-25 23:34:02 +09:00
Peter Zhu
f5c8bdaa8a Implement WeakKeyMap using weak references 2023-08-25 09:01:21 -04:00
Peter Zhu
ee9cc8e32e Implement WeakMap using weak references 2023-08-25 09:01:21 -04:00
Peter Zhu
2091bf9493 Expose stats about weak references
[Feature #19783]

This commit adds stats about weak references to `GC.latest_gc_info`.
It adds the following two keys:

- `weak_references_count`: number of weak references registered during
  the last GC.
- `retained_weak_references_count`: number of weak references that
  survived the last GC.
2023-08-25 09:01:21 -04:00
Peter Zhu
bfb395c620 Implement weak references in the GC
[Feature #19783]

This commit adds support for weak references in the GC through the
function `rb_gc_mark_weak`. Unlike strong references, weak references
does not mark the object, but rather lets the GC know that an object
refers to another one. If the child object is freed, the pointer from
the parent object is overwritten with `Qundef`.

Co-Authored-By: Jean Boussier <byroot@ruby-lang.org>
2023-08-25 09:01:21 -04:00
Peter Zhu
633243958c Add _without_gc functions to darray
These functions manipulate darray without the possibility of triggering
GC, which is used for places that cannot trigger GC. These functions
crash when the allocation fails.
2023-08-25 09:01:21 -04:00
Kevin Newton
7002d44c10
Fix merge conflict in lib/yarp/lex_compat.rb 2023-08-25 09:00:04 -04:00
Kevin Newton
ec7a2fdc03 [ruby/yarp] Fix up lex compat on Ruby HEAD
https://github.com/ruby/yarp/commit/7710cee248
2023-08-25 12:49:37 +00:00
Mike Dalessio
b8cab92a3f [ruby/yarp] fix: unterminated regular expression with a heredoc
Previously this snippet would track the same newline twice, leading to
a failed assertion in yp_newline_list_append.

https://github.com/ruby/yarp/commit/1d3fe19a94
2023-08-25 12:39:13 +00:00
Kevin Newton
90103f5d18 [ruby/yarp] Add the ability to serialize shared strings
https://github.com/ruby/yarp/commit/8d18c7ae29
2023-08-25 12:38:35 +00:00
Nobuyoshi Nakada
fe8f6dfed1 Remove yarp hack for BOM 2023-08-25 20:07:10 +09:00
Nobuyoshi Nakada
1f76e42b85 [Bug #19848] Flush BOM
The token just after BOM needs to position at column 0, so that the
indentation matches closing line.
2023-08-25 20:07:10 +09:00
David Rodríguez
023b8ddd22
[rubygems/rubygems] Don't use full indexes unnecessarily on legacy Gemfiles
On legacy Gemfiles with multiple remote sources, where all of them
support the compact index API, we were still falling back to full
indexes.

Fixing this also allows to simplifying the code.

https://github.com/rubygems/rubygems/commit/b1357c8e72
2023-08-25 18:34:47 +09:00
Jun Aruga
b5d0374635
[ruby/openssl] Fix LIBRESSL_VERSION_NUMBER document mistake.
* Fix the wrong man reference.
* According to the LIBRESSL_VERSION_NUMBER(3), the value always ends with 00f.

```
$ man -M /home/jaruga/.local/libressl-6650dce/share/man/ 3 LIBRESSL_VERSION_NUMBER
...
DESCRIPTION
     OPENSSL_VERSION_NUMBER and LIBRESSL_VERSION_NUMBER are numeric release version
     identifiers.  The first two digits contain the major release number, the third and
     fourth digits the minor release number, and the fifth and sixth digits the fix re‐
     lease number.  For OpenSSL, the seventh and eight digits contain the patch release
     number and the final digit is 0 for development, 1 to e for betas 1 to 14, or f
     for release.  For LibreSSL, OPENSSL_VERSION_NUMBER is always 0x020000000, and
     LIBRESSL_VERSION_NUMBER always ends with 00f.
```

https://github.com/ruby/openssl/commit/296c859d18
2023-08-25 18:34:47 +09:00