83249 Commits

Author SHA1 Message Date
Kevin Newton
d124124c16 [ruby/prism] Fix up gemspec
https://github.com/ruby/prism/commit/82e3126762
2024-01-16 19:01:36 +00:00
Jemma Issroff
8bf12d7b2f [ruby/prism] First pass at documenting information about the CRuby compiler
https://github.com/ruby/prism/commit/b575914b2f
2024-01-16 18:47:48 +00:00
Peter Zhu
07b9b53459 [PRISM] Fix crash with empty ensure blocks
Fixes ruby/prism#2179.
2024-01-16 12:55:57 -05:00
Matt Valentine-House
7bd7030a96 [PRISM] Replace local lookup recursion with loop 2024-01-16 12:43:53 -05:00
Peter Zhu
70a8ed0775 [PRISM] Don't allocate labels when not needed
The labels lstart, lend, lcont are only needed when there is a rescue
clause. They are not needed when there is only an ensure clause or
neither.
2024-01-16 12:43:14 -05:00
Peter Zhu
1caa881a56 [PRISM] Fix splat assignment
Fixes ruby/prism#2177
2024-01-16 11:12:06 -05:00
TSUYUSATO Kitsune
c5e43da426 [ruby/prism] Correct the "ambiguous first argument" condition
Fix https://github.com/ruby/prism/pull/2182

This change reflects this line:
6283ae8d36/parse.y (L11124).

https://github.com/ruby/prism/commit/a52588ff37
2024-01-16 15:51:09 +00:00
Nobuyoshi Nakada
6283ae8d36 [ruby/stringio] Update the coderange after overwrite
Fix https://bugs.ruby-lang.org/issues/20185

https://github.com/ruby/stringio/commit/8230552a46
2024-01-16 15:06:22 +00:00
Matt Valentine-House
fef8ccff11 Rename pm_lookup_local_index_any_scope
Now it's the only local lookup function we can just call it
pm_lookup_local_index
2024-01-16 14:58:55 +00:00
Matt Valentine-House
543bd7f3db Remove scope_node->local_depth_offset 2024-01-16 14:58:55 +00:00
Matt Valentine-House
1b97f61168 Remove pm_lookup_local_index_with_depth 2024-01-16 14:58:55 +00:00
Matt Valentine-House
0d705b342f Remove the found_depth pointer
Now that we're returning pm_local_index_t
2024-01-16 14:58:55 +00:00
Matt Valentine-House
da383c0d74 Return pm_local_index_t when looking up local indexes
instead of returning the index and updating found_depth in the parent
scope
2024-01-16 14:58:55 +00:00
Matt Valentine-House
f4b299a1ed Bind index & depth together into pm_local_index_t 2024-01-16 14:58:55 +00:00
Matt Valentine-House
3d45b743e4 Replace pm_lookup_local_index with lookup_local_index_with_depth 2024-01-16 14:58:55 +00:00
tompng
ade56737e2 Fix coderange of invalid_encoding_string.<<(ord)
Appending valid encoding character can change coderange from invalid to valid.
Example: "\x95".force_encoding('sjis')<<0x5C will be a valid string "\x{955C}"
2024-01-16 23:18:55 +09:00
Peter Zhu
0520e9675b [PRISM] Fix defined? for chained calls
Fixes ruby/prism#2148.
2024-01-16 08:32:21 -05:00
Nobuyoshi Nakada
d6b6e14c87
Specify ruby mode [ci skip] 2024-01-16 22:13:16 +09:00
Nobuyoshi Nakada
01459f1644
Set CHECK_LEAKS in spec/default.mspec
Because of `.NOEXPORT:` in template/Makefile.in, variables in
common.mk will not be exported.
2024-01-16 20:29:06 +09:00
Hiroshi SHIBATA
9f02680015
Removed sample code for net-imap. net-imap is alread extracted as bundled gems 2024-01-16 17:09:35 +09:00
git
ee405518d4 Update bundled gems list at 4b6936aa047158c98a9ac8861d51e5 [ci skip] 2024-01-16 08:07:41 +00:00
Hiroshi SHIBATA
4b6936aa04 Unbundled samples for getoptlong 2024-01-16 17:07:10 +09:00
Hiroshi SHIBATA
3f5016178c We don't need to sync getoptlong 2024-01-16 17:07:10 +09:00
Hiroshi SHIBATA
326288c5a5 Document about getoptlong at Ruby 3.4 2024-01-16 17:07:10 +09:00
Hiroshi SHIBATA
b3ff564967 spec/mspec/tool/wrap_with_guard.rb 'ruby_version_is ""..."3.4"' spec/ruby/library/getoptlong/**/*.rb 2024-01-16 17:07:10 +09:00
Hiroshi SHIBATA
b68dab2d0f Extract getoptlong as bundled gems 2024-01-16 17:07:10 +09:00
Hiroshi SHIBATA
c5d54e1db1
We don't need to sync mutex_m 2024-01-16 16:29:16 +09:00
Hiroshi SHIBATA
26cf40aaa0 Always enabled leakchecker by ruby/mspec 2024-01-16 16:24:37 +09:00
Nobuyoshi Nakada
924f3907c0
Enable spec_guards with 3.3 2024-01-16 12:44:28 +09:00
Nobuyoshi Nakada
be7c91db44
Do not pollute toplevel namespace 2024-01-16 12:43:53 +09:00
Nobuyoshi Nakada
0abbab9eb1
[Bug #20184] Test for low memory 2024-01-16 10:04:49 +09:00
Maxime Chevalier-Boisvert
6a1bf4cf1b
YJIT: optimized codegen for String#length (#9543)
Minor optimization for programs doing string processing.
2024-01-15 17:35:29 -05:00
Peter Zhu
6a175902f4 [PRISM] Fix keyword splat inside of array
Fixes ruby/prism#2155.
2024-01-15 17:12:53 -05:00
Peter Zhu
cc7b19e048 [DOC] Improve docs for GC.compact 2024-01-15 11:27:31 -05:00
Takashi Kokubun
5e61cc26c9
YJIT: Optimize Integer#succ (#9519) 2024-01-15 10:32:48 -05:00
Peter Zhu
7c6d7fbc28 [PRISM] Fix case without predicate
Fixes ruby/prism#2149.
2024-01-15 09:58:44 -05:00
Samuel Giddins
e0312f90bb [ruby/pp] Print beginless ranges properly
Instead of displaying the start of the range as nil

https://github.com/ruby/pp/commit/1df210d903
2024-01-15 14:04:14 +00:00
dependabot[bot]
9c3299896e Bump actions/upload-artifact from 4.0.0 to 4.1.0
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](c7d193f32e...1eb3cb2b3e)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-14 19:15:05 -08:00
Nobuyoshi Nakada
dde21a7967
Explicitly convert between VALUE and st_data_t 2024-01-15 09:35:46 +09:00
Samuel Williams
c5cf4d4e12
Improve behavioural consistency of unallocated (zero length) IO::Buffer. (#9532)
This makes the behaviour of IO::Buffer.new(0) and IO::Buffer.new.slice(0, 0) consistent.

Fixes https://bugs.ruby-lang.org/issues/19542 and https://bugs.ruby-lang.org/issues/18805.
2024-01-15 10:47:13 +13:00
Jeremy Evans
5c823aa686
Support keyword splatting nil
nil is treated similarly to the empty hash in this case, passing
no keywords and not calling any conversion methods.

Fixes [Bug #20064]

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2024-01-14 11:41:02 -08:00
Nobuyoshi Nakada
772413245f
Skip checking for symbol leaks in libruby.a linking extensions
The libruby.a linking extension libraries contain symbols exported
from extension libraries, and is not subject of test-leaked-globals.
2024-01-14 23:38:47 +09:00
NAITOH Jun
338eb0065b [ruby/strscan] StringScanner#captures: Return nil not "" for
unmached capture
(https://github.com/ruby/strscan/pull/72)

fix https://github.com/ruby/strscan/issues/70
If there is no substring matching the group (s[3]), the behavior is
different.

If there is no substring matching the group, the corresponding element
(s[3]) should be nil.

```
s = StringScanner.new('foobarbaz') #=> #<StringScanner 0/9 @ "fooba...">
s.scan /(foo)(bar)(BAZ)?/  #=> "foobar"
s[0]           #=> "foobar"
s[1]           #=> "foo"
s[2]           #=> "bar"
s[3]           #=> nil
s.captures #=> ["foo", "bar", ""]
s.captures.compact #=> ["foo", "bar", ""]
```

```
s = StringScanner.new('foobarbaz') #=> #<StringScanner 0/9 @ "fooba...">
s.scan /(foo)(bar)(BAZ)?/  #=> "foobar"
s[0]           #=> "foobar"
s[1]           #=> "foo"
s[2]           #=> "bar"
s[3]           #=> nil
s.captures #=> ["foo", "bar", nil]
s.captures.compact #=> ["foo", "bar"]
```

https://docs.ruby-lang.org/ja/latest/method/MatchData/i/captures.html
```
/(foo)(bar)(BAZ)?/ =~ "foobarbaz" #=> 0
$~.to_a        #=> ["foobar", "foo", "bar", nil]
$~.captures #=> ["foo", "bar", nil]
$~.captures.compact #=> ["foo", "bar"]
```

* StringScanner#captures is not yet documented.
https://docs.ruby-lang.org/ja/latest/class/StringScanner.html

https://github.com/ruby/strscan/commit/1fbfdd3c6f
2024-01-14 22:27:24 +09:00
Nobuyoshi Nakada
0610f555ea
Constify rb_global_parser_config 2024-01-14 17:55:11 +09:00
Nobuyoshi Nakada
4e5754a459
Add test for Errno constants 2024-01-14 00:24:14 +09:00
Nobuyoshi Nakada
55335eab80
Use STATIC_ASSERT 2024-01-13 23:43:07 +09:00
Nobuyoshi Nakada
9ba2558b76 Fix possible out-of-bounds access 2024-01-13 23:20:05 +09:00
yui-knk
ccd45a1399 Stop using Array to manage dummy end token locations
Before this commit, Array is used to store token locations
which expect `end` token, e.g. `class` and `module`.
This commit introduces dedicated struct to manage them
so that dependency on Ruby Object is reduced.
2024-01-13 20:41:22 +09:00
yui-knk
b92c8934a2 Lrama v0.6.1 2024-01-13 20:03:54 +09:00
Nobuyoshi Nakada
d999ed3a2f
Fix typo 2024-01-13 16:34:32 +09:00