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

83252 Коммитов

Автор SHA1 Сообщение Дата
Alan Wu 8d33be9833
[PRISM] Respect string encoding override in array literals
Fixes `TestZlibGzipReader#test_gets2`,
`Psych_Unit_Tests#test_spec_explicit_families`, and many failures in
`test_unicode_normalize.rb`.
2024-02-01 22:11:32 +00:00
Alan Wu 770b5499a5 [ruby/prism] Amend assert in pm_utf_8_codepoint(), n=0 is fine
This assert used to trip in the included test:
```
./miniruby --parser=prism -e ' "%W"\u" '
```

https://github.com/ruby/prism/commit/8c0f84db4f
2024-02-01 22:04:46 +00:00
Jenny Shen 4fbdbde088 [PRISM] dedup hash string keys
Fixes ruby/prism#2321

Co-authored-by:  Adrianna Chang <adrianna.chang@shopify.com>
Co-authored-by:  Peter Zhu <peter@peterzhu.ca>
2024-02-01 15:52:33 -05:00
Kevin Newton 332d2c92d8 [PRISM] Emit parse warnings 2024-02-01 15:52:19 -05:00
Alan Wu b47d43fa9b [PRISM] Use rb_fstring() on all string literals
In addition to saving space by deduplicating, this also makes the
literals have code range like TestObjSpace#test_dump_string_coderange
expects. It's testing a detail, but we might as well use rb_fstring().

Note that `putstring` makes a mutable duplicate, so passing it an
fstring is fine.
2024-02-01 15:50:32 -05:00
Nikita Vasilevsky c7fe3ecb49 [prism] Use block opening line as `source_location` line of lambda
There are several prism tests failing related to the `source_location`
for lambda returning line of the operator (`->`)
while original parser execution results in `source_location` line
pointing to the block opening location (`{` or `do`)

This commit changes `PM_LAMBDA_NODE` compilation case
to use block opening location instead of the whole node (operator)
opening location to get the line number to build block iseq
2024-02-01 15:23:39 -05:00
Jenny Shen e4e5a1b4ee [ruby/prism] Add parentheses around macro arguments
https://github.com/ruby/prism/commit/f81fe9c716

Co-authored-by:  Adrianna Chang <adrianna.chang@shopify.com>
Co-authored-by:  Peter Zhu <peter@peterzhu.ca>
2024-02-01 20:17:37 +00:00
Kevin Newton 29b7c31b08 [ruby/prism] Reject operator writes on operator methods
https://github.com/ruby/prism/commit/78bd142e71
2024-02-01 19:45:37 +00:00
Kevin Newton d3ba14a31d [PRISM] Do not shell out in prism tests 2024-02-01 14:13:22 -05:00
git ae0441358b Update default gems list at e9f1324464 [ci skip] 2024-02-01 17:53:16 +00:00
Kevin Newton e9f1324464 Sync to latest prism 2024-02-01 12:52:16 -05:00
Stan Lo ef427123ad [ruby/irb] Add rubocop with a few basic styling rules
(https://github.com/ruby/irb/pull/849)

* Use rubocop to enforce a few styling rules

* Add a CI job for linting

https://github.com/ruby/irb/commit/4f60cd88bb
2024-02-01 17:46:02 +00:00
Kevin Newton 494778c663 [ruby/prism] Remove locals_body_index
We're not using this anymore, and it doesn't make a lot of sense
outside the context of a compiler anyway, and in anyway it's wrong
when you have local variables written in default values.

https://github.com/ruby/prism/commit/5edbd9c25b
2024-02-01 16:48:55 +00:00
Haldun Bayhantopcu 67c5690a6d [ruby/prism] Check literals for receiver
https://github.com/ruby/prism/commit/56441b08e7
2024-02-01 16:48:09 +00:00
Stan Lo f36c61d27f [ruby/irb] Reset history counter even when @loaded_history_lines is
not defined
(https://github.com/ruby/irb/pull/853)

The issue (https://github.com/ruby/debug/issues/1064) is caused by a
combination of factors:

1. When user starts an IRB session without a history file, the
   `@loaded_history_lines` ivar is not defined.
2. If the user then starts the `irb:rdbg` session, the history counter
   is not set, because the `@loaded_history_lines` is not defined.
3. Because `irb:rdbg` saves the history before passing Ruby expression
   to the debugger, it saves the history with duplicated lines. The number
   grows in exponential order.
4. When the user exits the `irb:rdbg` session, the history file could be
   bloated with duplicated lines.

This commit fixes the issue by resetting the history counter even when
`@loaded_history_lines` is not defined.

https://github.com/ruby/irb/commit/4afc98c258
2024-02-01 16:19:07 +00:00
Kevin Newton 6ad585bd68 [ruby/prism] Only warn for unary + on spcarg
https://github.com/ruby/prism/commit/db0e5ce1ce
2024-02-01 16:13:46 +00:00
Alan Wu 1f226b41f0 [PRISM] Fix multiple return with splat and splat+kwsplat
Previously, `return *array, 1` didn't behave like `return [*array, 1]`
properly. Also, it crashed when splat and kwsplat is combined like in
`array = [*things, **hash]`.

Fix this by grouping `PM_ARGUMENTS_NODE` with `PM_ARRAY_NODE` handling and
combining splat and kwsplat handling.
2024-02-01 10:33:54 -05:00
Nobuyoshi Nakada 8531ac3115
Suppress unused-local-typedef warnings 2024-02-01 21:17:37 +09:00
Nuno Silva 1236a74023 [ruby/irb] Skip re-setup when creating a child session
(https://github.com/ruby/irb/pull/850)

https://github.com/ruby/irb/commit/06b2d00dd3
2024-02-01 12:12:06 +00:00
Nobuyoshi Nakada 8ba8e979c8
Parenthesize casted argument 2024-02-01 16:42:09 +09:00
Kevin Newton a7b47f96f3 [PRISM] Add splatkw to super calls when necessary 2024-01-31 22:18:55 -05:00
Kevin Newton d96b4586e4 [PRISM] Fix up index write nodes to match 2024-01-31 22:18:55 -05:00
Kevin Newton d36c31ed9b [PRISM] Fix keywords in index write nodes 2024-01-31 22:18:55 -05:00
Kevin Newton 8acd1f708f [PRISM] Fix combination of safe navigation and ||= and &&= operators 2024-01-31 22:18:55 -05:00
Kevin Newton 4d01c59042 [PRISM] Fix combination of attribute write and safe navigation 2024-01-31 22:18:55 -05:00
dependabot[bot] 7fd2c442e2 Bump ruby/setup-ruby from 1.170.0 to 1.171.0
Bumps [ruby/setup-ruby](https://github.com/ruby/setup-ruby) from 1.170.0 to 1.171.0.
- [Release notes](https://github.com/ruby/setup-ruby/releases)
- [Commits](bd03e04863...22fdc77bf4)

---
updated-dependencies:
- dependency-name: ruby/setup-ruby
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-31 18:39:13 -08:00
Samuel Williams 2554c5d3b8
Don't wait in `io_binwrite_string` if not necessary. (#9792) 2024-02-01 15:27:44 +13:00
KJ Tsanaktsidis da33c5ac9f Revert "Set AI_ADDRCONFIG when making getaddrinfo(3) calls for outgoing conns"
This reverts commit 673ed41c81cf5a6951bcb2c3dec82d7bd6ea7440.
2024-02-01 11:09:54 +11:00
KJ Tsanaktsidis 67404d657a Revert "always omit test_ai_addrconfig."
This reverts commit abf192eb16.
2024-02-01 11:09:54 +11:00
Stan Lo 6a689e3323 [ruby/irb] Omit 2 encoding error related tests for TruffleRuby
(https://github.com/ruby/irb/pull/854)

They're failing due to an issue in Prism: https://github.com/ruby/prism/issues/2129

So we need to skip them until:
- The issue is fixed in Prism
- TruffleRuby is updated to a version of Prism that includes the fix

https://github.com/ruby/irb/commit/bfafaa5fbc
2024-01-31 23:44:15 +00:00
Benoit Daloze 9fdfdf4fca [ruby/prism] Always return the character width for char_is_identifier_start() and char_is_identifier_utf8()
* This is also faster than calling pm_encoding_utf_8_alpha_char/pm_encoding_utf_8_alnum_char
  as those compute the character width and do extra checks.

https://github.com/ruby/prism/commit/4cb276ac4c
2024-01-31 21:29:16 +00:00
Kevin Newton b5a2c60d0a [PRISM] Support SCRIPT_LINES__ 2024-01-31 15:49:32 -05:00
Jeremy Evans c469799126 Do not modify provided argument splat when using ruby2_keywords with anonymous splat
Previously, this would push the provided keywords onto the argument
splat.  Add ruby2_keywords to the list of other checks for whether
it is safe for treating a given splat as mutable when the called
method accepts an anonymous splat.
2024-01-31 12:44:38 -08:00
Kevin Newton 71f16d498d Raise errors for dumping prism parse tree 2024-01-31 14:54:39 -05:00
Kevin Newton b4880af0e2 [PRISM] Fix test_bug_reporter with prism 2024-01-31 14:20:51 -05:00
Peter Zhu cb98b018c0 [PRISM] Fix else with rescue
Fixes ruby/prism#2307.
2024-01-31 14:11:14 -05:00
David Rodriguez 95c9711d6e [rubygems/rubygems] Fix musl platform not being added to the lockfile
https://github.com/rubygems/rubygems/commit/235f7b4266
2024-01-31 19:07:39 +00:00
Étienne Barrié c28ee91263 [PRISM] Fix incorrect use of VM_CALL_KW_SPLAT_MUT in zsuper with keyword splat
This copies the changes from 771a2f039b.
Fixes ruby/prism#2310.
2024-01-31 13:41:49 -05:00
Kevin Newton 610636fd6b [PRISM] Mirror iseq APIs
Before this commit, we were mixing a lot of concerns with the prism
compile between RubyVM::InstructionSequence and the general entry
points to the prism parser/compiler.

This commit makes all of the various prism-related APIs mirror
their corresponding APIs in the existing parser/compiler. This means
we now have the correct frame naming, and it's much easier to follow
where the logic actually flows. Furthermore this consolidates a lot
of the prism initialization, making it easier to see where we could
potentially be raising errors.
2024-01-31 13:41:36 -05:00
Takashi Kokubun 21031f0a84 YJIT: Float arithmetics are actually leaf
with these guards in YJIT.

The previous commit was to fix "conflict" between two PRs, but I
actually wanted to use it here, which is why I filed the other one.
2024-01-31 10:13:27 -08:00
Takashi Kokubun 2220c4cf42 YJIT: s/jit_prepare_routine_call/jit_prepare_non_leaf_call/ 2024-01-31 10:10:03 -08:00
Takashi Kokubun 09427f51a2
YJIT: Add codegen for Float arithmetics (#9774)
* YJIT: Add codegen for Float arithmetics

* Add Flonum and Fixnum tests
2024-01-31 17:58:47 +00:00
Takashi Kokubun cc9bbbdd80
YJIT: Add jit_prepare_for_gc function (#9775)
* YJIT: Add jit_prepare_for_gc function

* s/jit_prepare_routine_call/jit_prepare_non_leaf_call/

* s/jit_prepare_for_gc/jit_prepare_call_with_gc/

* Use jit_prepare_call_with_gc for leaf builtin
2024-01-31 17:54:10 +00:00
David Rodriguez 06732d4956 [rubygems/rubygems] Remove truffleruby specific stuff no longer needed
We're already testing with truffleruby 23.

https://github.com/rubygems/rubygems/commit/cd0494d628
2024-01-31 16:54:15 +00:00
Takashi Kokubun 51753ec7fa
Annotate Symbol#to_s as leaf (#9769) 2024-01-31 10:47:35 -05:00
David Rodriguez a322b2faa4 [rubygems/rubygems] Make slow perf specs more stable
This seems worse to detect performance regressions, but at least should
not have many false positives.

https://github.com/rubygems/rubygems/commit/0b28e55415
2024-01-31 13:22:38 +00:00
Hiroshi SHIBATA c70052e5d9 [rubygems/rubygems] WEBrick:Utils::TimeoutHandler is always provided after webrick gem
https://github.com/rubygems/rubygems/commit/b0502a0c50
2024-01-31 13:21:13 +00:00
Andrew Konchin 5808c86965 [ruby/prism] Fix description of line parsing option and state it's 1-indexed
https://github.com/ruby/prism/commit/b2d2b91222
2024-01-31 12:43:50 +00:00
David Rodriguez 171d4bec25 [rubygems/rubygems] Fix some flaky test failures on Windows
Some specs assert empty output, but sometimes they print warnings about
redefinition warnings. Ignore those until they are fixed upstream.

https://github.com/rubygems/rubygems/commit/0cd3b6dbae
2024-01-31 12:14:03 +00:00
Jun Aruga 816ce53a8a Revert ".travis.yml: Drop s390x temporarily."
This reverts commit 7ded31d36dc78c1495b03a45ec1a3235fdd81f1e.

I was told from Travis CI support that their infra team has deployed a fix for
the issue we encountered with the s390x build environment.
2024-01-31 09:56:39 +01:00