Age | Commit message (Collapse) | Author |
|
|
|
https://github.com/ruby/prism/commit/3a216e63fe
|
|
Fixes: ruby/prism#2212
|
|
Required keyword arguments need to come first.
Fixes: https://github.com/ruby/prism/issues/2158
Co-authored-by: Kevin Newton <[email protected]>
|
|
We need to run ensure code when breaking from a while loop
Co-authored-by: John Hawthorn <[email protected]>
Co-authored-by: Kevin Newton <[email protected]>
|
|
|
|
|
|
|
|
gems depend on it"
This reverts commit f1f5f22d22a149f20e019728b1ab35593d29d81a.
|
|
requiring a gem"
This reverts commit db44088c2a92040879386aa5f268db4c858e4e5b.
https://github.com/ruby/ruby/actions/runs/7578672002/job/20641640821
https://github.com/ruby/ruby/actions/runs/7578672002/job/20641641212
https://github.com/ruby/ruby/actions/runs/7578672002/job/20641642031
|
|
If a gem is required circular, and there are unresolved specs depending
on it, we may end up in an activation conflict.
The solution is to not try to activate unresolved gems when requiring a
default gem, regardless of it having already been activated or not.
https://github.com/rubygems/rubygems/commit/3b2b8f4e3e
|
|
depend on it
The following conditions must be met:
* A default gem is required.
* A previous require left some gems unresolved, and those dependencies
themselves depend on the default gem.
In this case, rubygems require will first activate the default version
of the gem, then try to activate another unresolved version of the
default gem that conflicts with the first activation.
The solution is, if we are in the middle of requiring a default gem,
skip this step, because we have already activated it successfully.
https://github.com/rubygems/rubygems/commit/8cd5608db5
Co-authored-by: Stan Hu <[email protected]>
|
|
(https://github.com/ruby/strscan/pull/80)
See: https://github.com/ruby/strscan/issues/78#issuecomment-1890849891
https://github.com/ruby/strscan/commit/d0508518a9
|
|
https://github.com/rubygems/rubygems/commit/b8ca5950a6
|
|
|
|
for dumping
https://github.com/ruby/psych/commit/3d051d89aa
|
|
(https://github.com/ruby/stringio/pull/77)
Followup of #79
`rb_str_resize()` was changed by https://github.com/ruby/ruby/commit/b0b9f7201acab05c2a3ad92c3043a1f01df3e17f .
```c
rb_str_resize(string, shorter) // clear ENC_CODERANGE in some case
rb_str_resize(string, longer) // does not clear ENC_CODERANGE anymore
```
```c
// rb_str_resize in string.c
if (slen > len && ENC_CODERANGE(str) != ENC_CODERANGE_7BIT) {
ENC_CODERANGE_CLEAR(str);
}
```
I think this change is based on an assumption that appending null bytes
will not change flag `ascii_only?`.
`strio_extend()` will make the string longer if needed, and update the
flags correctly for appending null bytes.
Before `memmove()`, we need to `rb_str_modify()` because updated flags are not
updated for `memmove()`.
https://github.com/ruby/stringio/commit/b31a538576
|
|
|
|
|
|
Ruby code:
```ruby
defined?(unless true; 1; end)
```
Instructions:
```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,16)>
0000 putobject "expression" ( 59)[Li]
0002 leave
"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,16)>
0000 putobject "expression" ( 58)[Li]
0002 leave
```
Related: ruby/prism#2188
|
|
Ruby code:
```ruby
defined?(until a == 1; end)
```
Instructions:
```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,16)>
0000 putobject "expression" ( 59)[Li]
0002 leave
"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,16)>
0000 putobject "expression" ( 58)[Li]
0002 leave
```
Related: ruby/prism#2188
|
|
Ruby code:
```ruby
defined?(while a != 1; end)
```
Instructions:
```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,16)>
0000 putobject "expression" ( 59)[Li]
0002 leave
"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,16)>
0000 putobject "expression" ( 58)[Li]
0002 leave
```
Related: ruby/prism#2188
|
|
Ruby code:
```ruby
defined?(class << self; end)
```
Instructions:
```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,16)>
0000 putobject "expression" ( 59)[Li]
0002 leave
"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,16)>
0000 putobject "expression" ( 58)[Li]
0002 leave
```
Related: ruby/prism#2188
|
|
Ruby code:
```ruby
defined?(1.2r)
```
Instructions:
```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,16)>
0000 putobject "expression" ( 59)[Li]
0002 leave
"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,16)>
0000 putobject "expression" ( 58)[Li]
0002 leave
```
Related: ruby/prism#2188
|
|
Ruby code:
```ruby
defined?(module M; end)
```
Instructions:
```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,16)>
0000 putobject "expression" ( 59)[Li]
0002 leave
"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,16)>
0000 putobject "expression" ( 58)[Li]
0002 leave
```
Related: ruby/prism#2188
|
|
Ruby code:
```ruby
defined?(1 => 1)
```
Instructions:
```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,16)>
0000 putobject "expression" ( 59)[Li]
0002 leave
"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,16)>
0000 putobject "expression" ( 58)[Li]
0002 leave
```
Related: ruby/prism#2188
|
|
Ruby code:
```ruby
defined?(/(?<foo>bar)/ =~ 'barbar')
```
Instructions:
```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,35)>
local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1])
[ 1] foo@0
0000 putobject "expression" ( 59)[Li]
0002 leave
"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,35)>
local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1])
[ 1] foo@0
0000 putobject "expression" ( 58)[Li]
0002 leave
```
Related: ruby/prism#2188
|
|
Ruby code:
```ruby
defined?(if true; 1; end)
```
Instructions:
```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,43)>
0000 putobject "expression" ( 59)[Li]
0002 leave
"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,43)>
0000 putobject "expression" ( 58)[Li]
0002 leave
```
Related: ruby/prism#2188
|
|
Ruby code:
```ruby
defined?(for i in [1,2] do; i; end)
```
Instructions:
```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,43)>
0000 putobject "expression" ( 59)[Li]
0002 leave
"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,43)>
0000 putobject "expression" ( 58)[Li]
0002 leave
```
Related: ruby/prism#2188
|
|
Ruby code:
```ruby
defined?(def prism_test_def_node; end)
```
Instructions:
```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,43)>
0000 putobject "expression" ( 59)[Li]
0002 leave
"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,43)>
0000 putobject "expression" ( 58)[Li]
0002 leave
```
Related: ruby/prism#2188
|
|
Ruby code:
```ruby
defined?(class PrismClassA; end)
```
Instructions:
```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,43)>
0000 putobject "expression" ( 59)[Li]
0002 leave
"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,43)>
0000 putobject "expression" ( 58)[Li]
0002 leave
```
Related: ruby/prism#2188
|
|
Ruby code:
```ruby
defined?(case [1, 2, 3]; in [1, 2, 3]; 4; end)
```
Instructions:
```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,43)>
0000 putobject "expression" ( 59)[Li]
0002 leave
"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,43)>
0000 putobject "expression" ( 58)[Li]
0002 leave
```
Related: ruby/prism#2188
|
|
Ruby code:
```ruby
defined?(case :a; when :a; 1; else; 2; end)
```
Instructions:
```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,43)>
0000 putobject "expression" ( 59)[Li]
0002 leave
"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,43)>
0000 putobject "expression" ( 58)[Li]
0002 leave
```
Related: ruby/prism#2188
|
|
`RescueModifier` was spelled wrong. Not a big deal, but it meant I
didn't immediately find the test when I was searching for it while
working on implementing `defined?` nodes.
|
|
Ruby code:
```ruby
defined?([0][0] ||= 1)
```
Instructions:
```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,58)>
0000 putobject "assignment" ( 59)[Li]
0002 leave
"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,58)>
0000 putobject "assignment" ( 58)[Li]
0002 leave
```
Related: ruby/prism#2188
|
|
Ruby code:
```ruby
defined?([0][0] += 1)
```
Instructions:
```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,58)>
0000 putobject "assignment" ( 59)[Li]
0002 leave
"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,58)>
0000 putobject "assignment" ( 58)[Li]
0002 leave
```
Related: ruby/prism#2188
|
|
Ruby code:
```ruby
defined?([0][0] &&= 1)
```
Instructions:
```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,58)>
0000 putobject "assignment" ( 59)[Li]
0002 leave
"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,58)>
0000 putobject "assignment" ( 58)[Li]
0002 leave
```
Related: ruby/prism#2188
|
|
Ruby code:
```ruby
defined?(Prism::CPWN = 1)
```
Instructions:
```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,58)>
0000 putobject "assignment" ( 59)[Li]
0002 leave
"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,58)>
0000 putobject "assignment" ( 58)[Li]
0002 leave
```
Related: ruby/prism#2188
|
|
Ruby code:
```ruby
defined?(Prism::CPOrWN ||= 1)
```
Instructions:
```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,58)>
0000 putobject "assignment" ( 59)[Li]
0002 leave
"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,58)>
0000 putobject "assignment" ( 58)[Li]
0002 leave
```
Related: ruby/prism#2188
|
|
Ruby code:
```ruby
defined?(Prism::CPOWN += 1)
```
Instructions:
```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,58)>
0000 putobject "assignment" ( 59)[Li]
0002 leave
"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,58)>
0000 putobject "assignment" ( 58)[Li]
0002 leave
```
Related: ruby/prism#2188
|
|
Ruby code:
```ruby
defined?(Prism::CPAWN &&= 1)
```
Instructions:
```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,58)>
0000 putobject "assignment" ( 59)[Li]
0002 leave
"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,58)>
0000 putobject "assignment" ( 58)[Li]
0002 leave
```
Related: ruby/prism#2188
|
|
Ruby code:
```ruby
defined?(PrismTestSubclass.test_call_or_write_node ||= 1)
```
Instructions:
```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,58)>
0000 putobject "assignment" ( 59)[Li]
0002 leave
"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,58)>
0000 putobject "assignment" ( 58)[Li]
0002 leave
```
Related: ruby/prism#2188
|
|
Ruby code:
```ruby
defined?(PrismTestSubclass.test_call_operator_write_node += 1)
```
Instructions:
```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,58)>
0000 putobject "assignment" ( 59)[Li]
0002 leave
"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,58)>
0000 putobject "assignment" ( 58)[Li]
0002 leave
```
Related: ruby/prism#2188
|
|
Ruby code:
```ruby
defined?(PrismTestSubclass.test_call_and_write_node &&= 1)
```
Instructions:
```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,58)>
0000 putobject "assignment" ( 59)[Li]
0002 leave
"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,58)>
0000 putobject "assignment" ( 58)[Li]
0002 leave
```
Related: ruby/prism#2188
|
|
If the argument is not a file or a string, it assumes it's a string
which will crash because RSTRING_PTR and RSTRING_LEN assumes it's a
string.
|
|
This caused it to fall into PM_ELSE_NODE which caused ensure nodes to be
compiled twice.
Fixes ruby/prism#2176.
|
|
https://github.com/ruby/prism/commit/94ecb366c4
|
|
https://github.com/ruby/prism/commit/24a2872b4e
|
|
https://github.com/ruby/prism/commit/a0c5361b9f
|
|
Fixes: https://github.com/ruby/openssl/issues/695
https://github.com/ruby/openssl/commit/95281fe4a9
|