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

82535 Коммитов

Автор SHA1 Сообщение Дата
Aaron Patterson 881c5a1846 [ruby/prism] Add a "repeated flag" to parameter nodes
It's possible to repeat parameters in method definitions like so:

```ruby
def foo(_a, _a)
end
```

The compiler needs to know to adjust the local table size to account for
these duplicate names.  We'll use the repeated parameter flag to account
for the extra stack space required

https://github.com/ruby/prism/commit/b443cb1f60

Co-Authored-By: Kevin Newton <kddnewton@gmail.com>
Co-Authored-By: Jemma Issroff <jemmaissroff@gmail.com>
2024-01-10 15:24:26 +00:00
Peter Zhu 8940922d18 [DOC] Improve doc for GC.latest_compact_info 2024-01-10 09:46:19 -05:00
KJ Tsanaktsidis 31371b2e24 Fix CRLF -> LF conversion on read for rb_io_fdopen & rb_file_open
When opening a file with `File.open`, and then setting the encoding with
`IO#set_encoding`, it still correctly performs CRLF -> LF conversion on
Windows when reading files with a CRLF line ending in them (in text
mode).

However, the file is opened instead with either the `rb_io_fdopen` or
`rb_file_open` APIs from C, the CRLF conversion is _NOT_ set up
correctly; it works if the encoding is not specified, but if
`IO#set_encoding` is called, the conversion stops happening. This seems
to be because the encflags never get ECONV_DEFAULT_NEWLINE_DECORATOR
set in these codepaths.

Concretely, this means that the conversion doesn't happen in the
following circumstances:
  * When loading ruby files with require (that calls rb_io_fdopen)
  * When parsing ruuby files with RubyVM::AbstractSyntaxTree (that calls
    rb_file_open).
This then causes the ErrorHighlight tests to fail on windows if git has
checked them out with CRLF line endings - the error messages it's
testing wind up with literal \r\n sequences in them because the iseq
text from the parser contains un-newline-converted strings.

This commit fixes the problem by copy-pasting the relevant snippet which
sets this up in `rb_io_extract_modeenc` (for the File.open path) into
the relevant codepaths for `rb_io_fdopen` and `rb_file_open`.

[Bug #20101]
2024-01-10 21:02:23 +11:00
git c4051d5f43 Update bundled gems list at 1500946ce4 [ci skip] 2024-01-10 08:28:55 +00:00
Hiroshi SHIBATA 1500946ce4 Added mutex_m to bundled gems 2024-01-10 17:28:16 +09:00
Hiroshi SHIBATA d16f992e1b Extract mutex_m as bundled gems 2024-01-10 17:28:16 +09:00
Nobuyoshi Nakada e59a730477
`st_index_t` is not `VALUE` 2024-01-10 14:06:33 +09:00
Nobuyoshi Nakada 48fd311721
Constify 2024-01-10 13:49:00 +09:00
Hiroshi SHIBATA 3ecfea6075
Need newline after changes list 2024-01-10 13:43:04 +09:00
Hiroya Fujinami 8b65d15ff0
Fix test case for `test_match_cache_with_peek_optimization` (#9466) 2024-01-10 13:40:20 +09:00
S-H-GAMELINKS a1949df547 Remove unnecessary semicolon and add break 2024-01-10 12:58:19 +09:00
Hiroya Fujinami 597955aae8
Fix to work match cache with peek next optimization (#9459) 2024-01-10 11:22:23 +09:00
Nobuyoshi Nakada 1817d644ee mkmf.rb: use kwargs 2024-01-10 09:18:18 +09:00
Akshay Birajdar c06745fec9 [DOC] Enhance documentation for `Array#zip` 2024-01-09 14:13:20 -05:00
Kevin Newton 80da9b1547 [ruby/prism] Clarify __END__ comment
https://github.com/ruby/prism/commit/3e36d5eabc
2024-01-09 19:02:26 +00:00
Peter Zhu 55b7121358 [PRISM] Frozen string literals should be fstrings
Frozen string literals should not just be frozen, but deduplicated as an
fstring so that two string literals with the same contents are the exact
same object.

Fixes ruby/prism#2095.
2024-01-09 12:24:18 -05:00
Mark Young 7015cb2479 [ruby/abbrev] Provide a 'Changelog' link on rubygems.org/gems/abbrev
By providing a 'changelog_uri' in the metadata of the gemspec a
'Changelog' link will be shown on https://rubygems.org/gems/abbrev
which makes it quick and easy for someone to check on the changes
introduced with a new version.

Details of this functionality can be found on https://guides.rubygems.org/specification-reference/

https://github.com/ruby/abbrev/commit/9643a03ee8
2024-01-09 16:07:39 +00:00
Kevin Newton 88d7838445 [ruby/prism] Fix assertion on spanning heredocs
https://github.com/ruby/prism/commit/e190308845
2024-01-09 15:15:52 +00:00
Peter Zhu 02d8bad6e1 Fix memory leak in parser for invalid syntax
The strterm is leaked when there is invalid syntax.

For example:

    10.times do
      100_000.times do
        begin
          RubyVM::InstructionSequence.compile('private def foo = puts "Hello"')
        rescue SyntaxError
        end
      end

      puts `ps -o rss= -p #{$$}`
    end

Before:

    20384
    26256
    32592
    36720
    42016
    47888
    53248
    57456
    62928
    65936

After:

    16720
    17488
    17616
    17616
    17616
    17616
    17616
    17616
    17616
    16032

Co-Authored-By: Kevin Newton <kddnewton@gmail.com>
2024-01-09 09:41:02 -05:00
Nobuyoshi Nakada 38bc107f0b
Convert a series of `else if` lines to a `switch` 2024-01-09 18:47:15 +09:00
Hiroshi SHIBATA 149373ce7f
racc is extracted at Ruby 3.3, not 3.4 2024-01-09 17:14:55 +09:00
Takashi Kokubun 23345cc699
Add Visual Studio 2015 job on GitHub Actions (#9452)
[[Feature #19982]](https://bugs.ruby-lang.org/issues/19982)
2024-01-09 00:12:11 -08:00
Nobuyoshi Nakada 7285b165a4 outdate-bundled-gems.rb: Make platform and version options optional 2024-01-09 16:42:20 +09:00
Nobuyoshi Nakada 1288e7e962 outdate-bundled-gems.rb: Remove timestamp files for revisions to test 2024-01-09 16:42:20 +09:00
Nobuyoshi Nakada 60cd5230f6 outdate-bundled-gems.rb: Sort outputs in depth order 2024-01-09 16:42:20 +09:00
Nobuyoshi Nakada 72a78ecd33 outdate-bundled-gems.rb: Add `--all` option
Unless this option is given, keep other gems that may be used by
`test-bundled-gems`.
2024-01-09 16:42:20 +09:00
Nobuyoshi Nakada bf108636df outdate-bundled-gems.rb: Add `--only={all,curdir,srcdir}` option 2024-01-09 16:42:20 +09:00
Nobuyoshi Nakada 963131a2d9 outdate-bundled-gems.rb: Pass platform and version explicitly
For different version baseruby, use the target platform and version
instead of the info of baseruby.
2024-01-09 16:42:20 +09:00
Nobuyoshi Nakada 8f61617a95 outdate-bundled-gems.rb: Do not clean the same directory twice 2024-01-09 16:42:20 +09:00
yui-knk db476cc71c Introduce NODE_SYM to manage symbol literal
`:sym` was managed by `NODE_LIT` with `Symbol` object.
This commit introduces `NODE_SYM` so that

1. Symbol literal is detectable from AST Node
2. Reduce dependency on ruby object
2024-01-09 16:07:19 +09:00
Hiroshi SHIBATA f82a6172a2
Avoid the duplicated entries of GitHub releases 2024-01-09 14:53:22 +09:00
Nobuyoshi Nakada 4b01983bf8
Simplify empty hahs with DSTAR 2024-01-09 13:05:34 +09:00
Nobuyoshi Nakada a4406bc89a
Extract repeating NODE references as a local variable 2024-01-09 13:04:26 +09:00
Peter Zhu 37ed86fd3c Fix memory leak in regexp grapheme clusters
[Bug #20161]

The cc->mbuf gets overwritten, so we need to free it to not leak memory.

For example:

    str = "hello world".encode(Encoding::UTF_32LE)

    10.times do
      1_000.times do
        str.grapheme_clusters
      end

      puts `ps -o rss= -p #{$$}`
    end

Before:

    15536
    15760
    15920
    16144
    16304
    16480
    16640
    16784
    17008
    17280

After:

    15584
    15584
    15760
    15824
    15888
    15888
    15888
    15888
    16048
    16112
2024-01-08 19:50:34 -05:00
Takashi Kokubun 0a30fc6211 Remove obsoleted lldb_yjit.py
which clearly seems to be written for Ruby 3.1 YJIT that was not
rewritten in Rust yet. Since it has been left there as is, I don't think
anybody is actively using this script. We could add a new one if we need
it again.
2024-01-08 15:51:15 -08:00
yui-knk 5ecf2d2880 Use `strcmp` to compare strings 2024-01-09 07:42:44 +09:00
Avdi Grimm 544c87d009 [rubygems/rubygems] Refer to underscores as underscores
https://github.com/rubygems/rubygems/commit/aa3ae5d245
2024-01-08 21:45:25 +00:00
Koichi Sasada 41dd15944f fix `rb_thread_wait_for_single_fd` on non MN case
`rb_thread_wait_for_single_fd(fd)` waits until `fd` is ready.
Without MN it shouldn't use `thread_io_wait_events()` for the
retry checking (alwasy false if MN is not active).
2024-01-09 05:43:28 +09:00
Matt Valentine-House 47ff4a1658 [PRISM] Blocks should track the found local depth
Rather than rely purely on local depth offset. This is because we can't
assume a specific depth offset for all variable accesses happening
within a block in the same way that we can for rescue/ensure/for or
other nodes that push scopes.

This is because block parameters are defined in the scope level, so we
always need to start from the top most scope and walk backwards.

Fixes ruby/prism@2053
2024-01-08 19:55:26 +00:00
dependabot[bot] 94a98ce632 [rubygems/rubygems] Bump rb-sys
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.85 to 0.9.86.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.85...v0.9.86)

---
updated-dependencies:
- dependency-name: rb-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

https://github.com/rubygems/rubygems/commit/6ec9f14b61
2024-01-08 19:40:44 +00:00
dependabot[bot] 4c3c5b645f [rubygems/rubygems] Bump rb-sys
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.85 to 0.9.86.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.85...v0.9.86)

---
updated-dependencies:
- dependency-name: rb-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

https://github.com/rubygems/rubygems/commit/070a6d9398
2024-01-08 19:40:28 +00:00
Matthew Healy c39c49cb24 [ruby/prism] Add missing comment key
https://github.com/ruby/prism/commit/723480a107
2024-01-08 18:47:18 +00:00
matthew healy eef74d8367 [ruby/prism] Fix spacing in documentation comment
https://github.com/ruby/prism/commit/8408961e76

Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2024-01-08 18:47:17 +00:00
Matthew Healy d02455afc1 [ruby/prism] Add comments documenting RangeNode fields
https://github.com/ruby/prism/commit/e6aef6499b
2024-01-08 18:47:17 +00:00
matthew healy 1e7d1da3b0 [ruby/prism] Clarify keys and values in AssocNode must be non-void
https://github.com/ruby/prism/commit/0caca53a2c

Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2024-01-08 18:47:06 +00:00
Matthew Healy b57c5e560e [ruby/prism] Add comments for AssocSplatNode fields
https://github.com/ruby/prism/commit/a0fd874848
2024-01-08 18:47:06 +00:00
Matthew Healy 04ae8fb3a9 [ruby/prism] Add comments for AssocNode fields
https://github.com/ruby/prism/commit/fb60072a1e
2024-01-08 18:47:06 +00:00
Matthew Healy 7e09dd433b [ruby/prism] Add comments for HashNode fields
https://github.com/ruby/prism/commit/649e209519
2024-01-08 18:47:05 +00:00
Takashi Kokubun a0eecfb5ba
YJIT: Fallback Integer#<< if a shift amount varies (#9426)
* YJIT: Fallback Integer#<< if a shift amount varies

* YJIT: Do not fallback lshift in the first chain
2024-01-08 17:34:57 +00:00
Peter Zhu 85a7da742a [DOC] Escape File in documentation 2024-01-08 11:30:29 -05:00