aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [PRISM] Account for nil parent in Call{Operator,And,Or}PathWriteNodesJemma Issroff2023-12-062-3/+21
| | | | | | | Prior to this commit, we were not accounting for the case of a nil parent in a CallXPathWriteNode, for example ::A ||= 1. This commit checks if the parent exists, and if not, uses Object as the inferred parent
* [ruby/bigdecimal] Clarify that JSON methods come from the JSON gemPeter Zhu2023-12-061-1/+1
| | | | https://github.com/ruby/bigdecimal/commit/581725d4e5
* Deduplicate assertions in redblack_balancePeter Zhu2023-12-061-40/+10
| | | | | The bug in i686 was fixed in commit 71babe5536bdb2238509752d8706194ee57ff485.
* [ruby/bigdecimal] [DOC] Add section Methods for Working with JSONBurdetteLamar2023-12-061-1/+14
| | | | https://github.com/ruby/bigdecimal/commit/2edd8d0a23
* [ruby/prism] Add locals_body_index to DefNode, BlockNode, LambdaNodeJemma Issroff2023-12-06291-3/+873
| | | | | | | | The locals_body_index gives the index in the locals array where the locals from the body start. This allows compilers to easily index past the parameters in the locals array. https://github.com/ruby/prism/commit/5d4627b890
* [PRISM] Implement `PM_MATCH_PREDICATE_NODE` for `defined?`eileencodes2023-12-062-0/+2
| | | | | | | | | | | | | | | | | | | | | | Ruby code: ```ruby defined? 1 in 1 ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,16)> 0000 putobject "expression" 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,16)> 0000 putobject "expression" 0002 leave ```
* [PRISM] Implement `PM_KEYWORD_HASH_NODE` for `defined?`eileencodes2023-12-062-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ruby code: ```ruby defined? [a: [:b, :c]] ``` Instructions (without optimizations): ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,23)> == catch table | catch type: rescue st: 0001 ed: 0007 sp: 0000 cont: 0009 | == disasm: #<ISeq:defined guard in <compiled>@<compiled>:0 (0,0)-(-1,-1)> | local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1]) | [ 1] "$!"@0 | 0000 putnil | 0001 leave |------------------------------------------------------------------------ 0000 putnil 0001 putobject true 0003 branchunless 9 0005 putobject "expression" 0007 swap 0008 pop 0009 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,23)> == catch table | catch type: rescue st: 0000 ed: 0009 sp: 0000 cont: 0009 | == disasm: #<ISeq:defined guard in <compiled>@<compiled>:0 (0,0)-(-1,-1)> | local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1]) | [ 1] "$!"@0 | 0000 putnil | 0001 leave |------------------------------------------------------------------------ 0000 putnil 0001 putobject true 0003 branchunless 9 0005 putobject "expression" 0007 swap 0008 pop 0009 leave ``` Instructions (with optimizations): ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,23)> == catch table | catch type: rescue st: 0001 ed: 0003 sp: 0000 cont: 0005 | == disasm: #<ISeq:defined guard in <compiled>@<compiled>:0 (0,0)-(-1,-1)> | local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1]) | [ 1] "$!"@0 | 0000 putnil | 0001 leave |------------------------------------------------------------------------ 0000 putnil 0001 putobject "expression" 0003 swap 0004 pop 0005 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,23)> == catch table | catch type: rescue st: 0000 ed: 0005 sp: 0000 cont: 0005 | == disasm: #<ISeq:defined guard in <compiled>@<compiled>:0 (0,0)-(-1,-1)> | local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1]) | [ 1] "$!"@0 | 0000 putnil | 0001 leave |------------------------------------------------------------------------ 0000 putnil 0001 putobject "expression" 0003 swap 0004 pop 0005 leave ```
* [PRISM] Implement `PM_SPLAT_NODE` for `defined?`eileencodes2023-12-062-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | In an array for `defined?` we need to check if there is a `contains_splat` flag, if so bail early. Ruby code: ```ruby defined?([[*1..2], 3, *4..5]) ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,29)> 0000 putobject "expression" 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,29)> 0000 putobject "expression" 0002 leave ```
* [PRISM] Implement `PM_SOURCE_LINE_NODE` for `defined?`eileencodes2023-12-062-0/+2
| | | | | | | | | | | | | | | | | | | | | | Ruby code: ```ruby defined?(__LINE__) ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,18)> 0000 putobject "expression" 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,18)> 0000 putobject "expression" 0002 leave ```
* [PRISM] Implement `PM_SOURCE_FILE_NODE` for `defined?`eileencodes2023-12-062-0/+2
| | | | | | | | | | | | | | | | | | | | | | Ruby code: ```ruby defined?(__FILE__) ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,18)> 0000 putobject "expression" 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,18)> 0000 putobject "expression" 0002 leave ```
* [PRISM] Implement `PM_SOURCE_ENCODING_NODE` for `defined?eileencodes2023-12-062-0/+2
| | | | | | | | | | | | | | | | | | | | | | Ruby code: ```ruby defined?(__ENCODING__) ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,22)> 0000 putobject "expression" 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,22)> 0000 putobject "expression" 0002 leave ```
* [PRISM] Implement `PM_IMAGINARY_NODE` for `defined?`eileencodes2023-12-062-0/+2
| | | | | | | | | | | | | | | | | | | | | | Ruby Code: ``` defined?(1i) ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,12)> 0000 putobject "expression" 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,12)> 0000 putobject "expression" 0002 leave ```
* [PRISM] Compile Rescue Modifier nodesMatt Valentine-House2023-12-062-2/+59
|
* [ruby/prism] Update snapshotHaldun Bayhantopcu2023-12-061-0/+1
| | | | https://github.com/ruby/prism/commit/5f0ea09785
* Add NEWS entry about Encoding#replicateBenoit Daloze2023-12-061-0/+5
|
* [DOC] Fixed document positionNobuyoshi Nakada2023-12-061-11/+11
| | | | | | Method documentation must be placed immediately before each implementation, without any other functions or preprocessor directives.
* [rubygems/rubygems] Try to load Gem::BUNDLED_GEMS on BundlerHiroshi SHIBATA2023-12-061-0/+5
| | | | | | | `bundle exec ruby foo.rb` ignore to load gem_prelude.rb. Because warnings feature is not working with `bundle exec ruby`. https://github.com/rubygems/rubygems/commit/a0d4ed92a7
* [ruby/rdoc] Only word-ending colon separates new definitionNobuyoshi Nakada2023-12-062-3/+9
| | | | | | | When followed by non-space characters, rather it looks like a URL or a path name on Windows. https://github.com/ruby/rdoc/commit/72c6560773
* [ruby/rdoc] Needs more backslash to match escaping backslashsNobuyoshi Nakada2023-12-061-2/+1
| | | | https://github.com/ruby/rdoc/commit/1904e9076d
* [ruby/rdoc] Use single quotes to keep backslash literallyNobuyoshi Nakada2023-12-061-1/+1
| | | | https://github.com/ruby/rdoc/commit/4ac9be7f48
* Refine the NEWS entry for bundler warningYusuke Endoh2023-12-061-4/+4
|
* Fix incorrect "nested_fake_name" documentation. (#9135)Samuel Williams2023-12-061-1/+1
|
* Add news for `Fiber#kill`. (#9134)Samuel Williams2023-12-061-0/+20
|
* Fix RCLASS_EXT dump [ci skip]Nobuyoshi Nakada2023-12-061-1/+1
|
* Adjust styles [ci skip]Nobuyoshi Nakada2023-12-061-2/+4
|
* [rubygems/rubygems] test_bundled_ca.rb: Add Net::OpenTimeout as a offline case.Jun Aruga2023-12-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It seems that when DNS connection is enabled, but the TCP connection is disabled in a way, the `Net::HTTP.connect` raises `Net::OpenTimeout`. And I want to skip the tests in this case. https://github.com/ruby/net-http/blob/042faf74e77d786ff60dff81555f6ec4f21e77a9/lib/net/http.rb#L1601-L1608 ``` 1) Error: TestBundledCA#test_accessing_new_index: Net::OpenTimeout: execution expired /builddir/build/BUILD/ruby-3.0.4/lib/net/http.rb:987:in `initialize' /builddir/build/BUILD/ruby-3.0.4/lib/net/http.rb:987:in `open' /builddir/build/BUILD/ruby-3.0.4/lib/net/http.rb:987:in `block in connect' /builddir/build/BUILD/ruby-3.0.4/lib/timeout.rb:107:in `timeout' /builddir/build/BUILD/ruby-3.0.4/lib/net/http.rb:985:in `connect' /builddir/build/BUILD/ruby-3.0.4/lib/net/http.rb:970:in `do_start' /builddir/build/BUILD/ruby-3.0.4/lib/net/http.rb:959:in `start' /builddir/build/BUILD/ruby-3.0.4/lib/net/http.rb:1512:in `request' /builddir/build/BUILD/ruby-3.0.4/lib/net/http.rb:1270:in `get' /builddir/build/BUILD/ruby-3.0.4/test/rubygems/test_bundled_ca.rb:34:in `assert_https' /builddir/build/BUILD/ruby-3.0.4/test/rubygems/test_bundled_ca.rb:58:in `test_accessing_new_index' ... ``` https://github.com/rubygems/rubygems/commit/5defe0a2f6
* [rubygems/rubygems] Use String#unpack1 available since ruby 3.0Martin Emde2023-12-063-4/+3
| | | | https://github.com/rubygems/rubygems/commit/46258d6cb4
* Revert "allow enabling Prism via flag or env var"HParker2023-12-068-550/+52
| | | | This reverts commit 9b76c7fc89460ed8e9be40e4037c1d68395c0f6d.
* Adjust styles [ci skip]Nobuyoshi Nakada2023-12-063-5/+10
|
* Don't warn generally for `IO::Buffer`, only on specific code paths e.g. ↵Samuel Williams2023-12-061-2/+0
| | | | `map`. (#9131)
* Fix parameter types for rb_ivar_foreach() callbacksAlan Wu2023-12-054-19/+11
| | | | | | | | For this public API, the callback is declared to take `(ID, VALUE, st_data_t)`, but it so happens that using `(st_data_t, st_data_t, st_data_t)` also type checks, because the underlying type is identical. Use it as declared and get rid of some casts.
* Fix alphabetical order of include in shape.cPeter Zhu2023-12-051-1/+1
|
* [rubygems/rubygems] Converts Bundler lockfile checksum validation to opt-in onlyMartin Emde2023-12-0528-827/+869
| | | | | | | | | Looks for the CHECKSUMS section in the lockfile, activating the feature only if the section exists. Without a CHECKSUMS section, Bundler will continue as normal, validating checksums when gems are installed while checksums from the compact index are present. https://github.com/rubygems/rubygems/commit/2353cc93a4
* [ruby/prism] Fix defined with new lineeileencodes2023-12-053-9/+24
| | | | | | | | | | | | | | | It's possible to write the following and have it be valid Ruby: ``` defined?("foo" ) ``` But Prism wasn't taking the new line into account. This adds an `accept1` for a `PM_TOKEN_NEWLINE` to account for this. I've also updated the fixtures and snapshots to test this. https://github.com/ruby/prism/commit/b87f8eedc6
* [ruby/syntax_suggest] Change assertion to not rely on exact text from prismSchneems2023-12-051-5/+1
| | | | | | | | The original ripper test was very stable as the output didn't change. Prism is under active development and changing their output shouldn't cause a failure to the ruby/ruby test suite like https://github.com/ruby/ruby/actions/runs/7104601478/job/19339940315. This commit moves from checking exact output to asserting that the string we get back is not empty. This should give the same level of confidence that some error message was caught, and is less brittle. https://github.com/ruby/syntax_suggest/commit/4b6abb763e
* YJIT: Assert code pages are not partially in-boundsAlan Wu2023-12-051-0/+4
| | | | Helps understand page switching
* YJIT: Simplify code page switching logic, remove an assertAlan Wu2023-12-051-9/+8
| | | | | | | | | | | | | | We have received a report of `assert!( !cb.has_dropped_bytes())` in set_page() failing. The only explanation for this seems to be memory allocation failing in write_byte(). The if condition implies that `current_write_pos < dst_pos < mem_size`, which rules out failing to encode the relative jump. The has_capacity() assert above not tripping implies that we were in a place in the page where write_byte() did attempt to write the byte and potentially made a syscall in the process. Remove the assert, since memory allocation could fail. Also, return failure if the destination is outside of the code region to detect that out-of-memory situation quicker.
* [ruby/syntax_suggest] Remove duplicate error messagesSchneems2023-12-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: ``` Expected a newline or semicolon after the statement Cannot parse the expression Expected a newline or semicolon after the statement Cannot parse the expression 1 describe "webmock tests" do 22 it "body" do 27 query = Cutlass::FunctionQuery.new( > 28 port: port > 29 body: body 30 ).call 34 end 35 end ``` After: ``` Expected a newline or semicolon after the statement Cannot parse the expression 1 describe "webmock tests" do 22 it "body" do 27 query = Cutlass::FunctionQuery.new( > 28 port: port > 29 body: body 30 ).call 34 end 35 end ``` https://github.com/ruby/syntax_suggest/commit/becf097e5e
* [ruby/syntax_suggest] Update docs, clean up PRSchneems2023-12-057-17/+26
| | | | | | Removes or updates mentions of Ripper https://github.com/ruby/syntax_suggest/commit/08aaa3f50a
* [ruby/syntax_suggest] Support lexing with PrismSchneems2023-12-054-19/+33
| | | | https://github.com/ruby/syntax_suggest/commit/7f4176a914
* [ruby/syntax_suggest] Initial support for the prism parserSchneems2023-12-054-14/+76
| | | | | | | | | | | | | | Prism will be the parser in Ruby 3.3. We need to support 3.0+ so we will have to "dual boot" both parsers. Todo: - LexAll to support Prism lex output - Add tests that exercise both Ripper and prism codepaths on CI - Handle https://github.com/ruby/prism/issues/1972 in `ripper_errors.rb` - Update docs to not mention Ripper explicitly - Consider different/cleaner APIs for separating out Ripper and Prism https://github.com/ruby/syntax_suggest/commit/a7d6991cc4
* allow enabling Prism via flag or env varHParker2023-12-058-52/+547
| | | | | | | | | | Enable Prism using either --prism ruby --prism test.rb or via env var RUBY_PRISM=1 ruby test.rb
* Update default gems list at b29ed638833f2abc7ce99b5bbf5cd0 [ci skip]git2023-12-051-1/+1
|
* [ruby/irb] Bump version to v1.10.1Stan Lo2023-12-051-2/+2
| | | | | | (https://github.com/ruby/irb/pull/801) https://github.com/ruby/irb/commit/a1e431bd83
* [ruby/irb] Disable pager when TERM is not set tooStan Lo2023-12-051-1/+1
| | | | | | (https://github.com/ruby/irb/pull/802) https://github.com/ruby/irb/commit/173980974b
* [ruby/irb] Pager should be disabled when TERM=dumbStan Lo2023-12-051-1/+5
| | | | | | | | | | | (https://github.com/ruby/irb/pull/800) For apps/libs that test against IRB, it's recommended to set `TERM=dumb` so they get minimum disruption from Reline's interactive-focus features. Therefore, we should follow the convention to disable pager when `TERM=dumb`. https://github.com/ruby/irb/commit/8a3002a39e
* [ruby/prism] Remove unnecessary matchHaldun Bayhantopcu2023-12-051-5/+1
| | | | https://github.com/ruby/prism/commit/694d3d7279
* [ruby/prism] Fix a typoTSUYUSATO Kitsune2023-12-051-1/+1
| | | | | | https://github.com/ruby/prism/pull/1949#discussion_r1412568793 https://github.com/ruby/prism/commit/a00f21d10a
* [ruby/prism] Add test casesTSUYUSATO Kitsune2023-12-053-121/+159
| | | | https://github.com/ruby/prism/commit/e91f8dbb99
* [ruby/prism] Fix argument orderTSUYUSATO Kitsune2023-12-051-112/+112
| | | | | | | | https://github.com/ruby/prism/pull/1949#discussion_r1410733341 https://github.com/ruby/prism/commit/27635da821 Co-Authored-By: Kevin Newton <kddnewton@gmail.com>