| Age | Commit message (Collapse) | Author |
|
https://github.com/ruby/prism/commit/9c12be6e6a
|
|
https://github.com/ruby/prism/commit/91f60cb736
|
|
`compact_child_nodes` allocates an array. We can skip that step by simply yielding the nodes.
Benchmark for visiting the rails codebase:
```rb
require "prism"
require "benchmark/ips"
files = Dir.glob("../rails/**/*.rb")
results = files.map { Prism.parse_file(it) }
visitor = Prism::Visitor.new
Benchmark.ips do |x|
x.config(warmup: 3, time: 10)
x.report do
results.each do
visitor.visit(it.value)
end
end
end
RubyVM::YJIT.enable
Benchmark.ips do |x|
x.config(warmup: 3, time: 10)
x.report do
results.each do
visitor.visit(it.value)
end
end
end
```
Before:
```
ruby 3.4.8 (2025-12-17 revision https://github.com/ruby/prism/commit/995b59f666) +PRISM [x86_64-linux]
Warming up --------------------------------------
1.000 i/100ms
Calculating -------------------------------------
2.691 (± 0.0%) i/s (371.55 ms/i) - 27.000 in 10.089422s
ruby 3.4.8 (2025-12-17 revision https://github.com/ruby/prism/commit/995b59f666) +YJIT +PRISM [x86_64-linux]
Warming up --------------------------------------
1.000 i/100ms
Calculating -------------------------------------
7.278 (±13.7%) i/s (137.39 ms/i) - 70.000 in 10.071568s
```
After:
```
ruby 3.4.8 (2025-12-17 revision https://github.com/ruby/prism/commit/995b59f666) +PRISM [x86_64-linux]
Warming up --------------------------------------
1.000 i/100ms
Calculating -------------------------------------
3.429 (± 0.0%) i/s (291.65 ms/i) - 35.000 in 10.208580s
ruby 3.4.8 (2025-12-17 revision https://github.com/ruby/prism/commit/995b59f666) +YJIT +PRISM [x86_64-linux]
Warming up --------------------------------------
1.000 i/100ms
Calculating -------------------------------------
16.815 (± 0.0%) i/s (59.47 ms/i) - 169.000 in 10.054668s
```
~21% faster on the interpreter, ~56% with YJIT
https://github.com/ruby/prism/commit/bf631750cf
|
|
https://github.com/ruby/prism/commit/21c499d6e4
|
|
Fixes https://github.com/ruby/prism/pull/3786.
https://github.com/ruby/prism/commit/b72b664675
|
|
https://github.com/ruby/prism/commit/a20afe1674
|
|
https://github.com/ruby/prism/commit/7eb169513a
|
|
When there are nested capture variables inside of a pattern match
that has an alternation pattern, it is a syntax error. Currently it
only adds a syntax error when it is at the top level of the pattern.
|
|
Fixes [Bug #21661]
https://github.com/ruby/prism/commit/475fa46a82
|
|
Should fail even with `-c` option.
|
|
https://github.com/ruby/prism/commit/b72fcc6183
|
|
https://github.com/ruby/prism/commit/7574837b7b
|
|
type. Since a endless method is started with `=`, there was ambiguity here. We have to simply reject these in all cases.
This adds a new error for the following reason:
* `def foo arg = nil` is interpreted as a normal method call with optional `arg` without matching `end`
* `def foo *arg = nil; end` is interpreted as a endless method call that has body `nil` with extraneous `end`
`def foo *arg = nil` is somewhere inbetween and I don't know how to otherwise indicate the error.
Now the second case above also shows the newly added error message.
Fixes [Bug #21623]
https://github.com/ruby/prism/commit/e1910d4492
|
|
This allows us to use the "last" of the enums in order to make masks,
etc. This particular commit uses the call flag's last enum field as an
offset so that we can define "private" flags but not accidentally
clobber any newly added call node flags.
https://github.com/ruby/prism/commit/e71aa980d8
|
|
https://github.com/ruby/prism/commit/cac5118884
|
|
https://github.com/ruby/prism/commit/194edab827
|
|
command calls
https://github.com/ruby/prism/commit/d9151b8a82
|
|
A command-call-like `not true` must be rejected after `&&` and `||`.
https://bugs.ruby-lang.org/issues/21337
https://github.com/ruby/prism/commit/0513cf22ad
|
|
command calls
https://github.com/ruby/prism/commit/d9151b8a82
|
|
A command-call-like `not true` must be rejected after `&&` and `||`.
https://bugs.ruby-lang.org/issues/21337
https://github.com/ruby/prism/commit/0513cf22ad
|
|
https://github.com/ruby/prism/commit/5aa963f8e6
|
|
https://github.com/ruby/prism/commit/1cae6e3b02
|
|
https://github.com/ruby/prism/commit/ba019ab4b4
|
|
https://github.com/ruby/prism/commit/de1faa1680
|
|
https://github.com/ruby/prism/commit/12af4e144e
|
|
The current implementation of the visitor pattern in Prism uses
a single method (`visit_child_nodes`) to handle all node types. This can lead to performance issues since the `node` argument will end up being polymorphic, and will prevent effective use of inline caches, which in CRuby are monomorphic.
This commit generates an inlined version of the previous code for each node type, thus making the calls inside visitor methods monomorphic. This should improve performance, especially in cases where the visitor is called frequently.
https://github.com/ruby/prism/commit/60d324a701
|
|
provided snce Ruby 2.3
Notes:
Merged: https://github.com/ruby/ruby/pull/13311
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13275
|
|
|
|
https://github.com/ruby/prism/commit/594e2a69ed
|
|
* See https://github.com/ruby/prism/issues/3502
https://github.com/ruby/prism/commit/b7aedfe696
|
|
https://github.com/ruby/prism/commit/93e768bd18
|
|
Instead of requiring the consumer to provide a list of all events which
they wish to handle, we can give them to option of dynamically detecting
them, by scanning the listener's public methods.
This approach is similar to that used by Minitest (scanning for `test_`
methods) and Rails generators (running all public methods in the order
they are defined).
While this is slower than specifying a hard coded list, the penalty is
only during registration. There is no change the the behaviour of
dispatching the events.
https://github.com/ruby/prism/commit/781ebed743
|
|
https://github.com/ruby/prism/commit/c02429765b
|
|
https://github.com/ruby/prism/commit/71d31db496
|
|
https://github.com/ruby/prism/commit/56eaf53732
|
|
https://github.com/ruby/prism/commit/10e5431b38
|
|
https://github.com/ruby/prism/commit/8ab2532f09
|
|
To make it so that you can pass `freeze: true` to Prism parse
methods and get back a deeply-frozen AST that is Ractor-
shareable.
https://github.com/ruby/prism/commit/8e6a93b2d2
|
|
https://github.com/ruby/prism/commit/8d9d429155
|
|
https://github.com/ruby/prism/commit/a679ee0e5c
|
|
Fix https://bugs.ruby-lang.org/issues/20977
Notes:
Merged: https://github.com/ruby/ruby/pull/12424
|
|
https://github.com/ruby/prism/commit/817a8e39d9
Notes:
Merged: https://github.com/ruby/ruby/pull/12358
|
|
https://github.com/ruby/prism/commit/f80026883d
Notes:
Merged: https://github.com/ruby/ruby/pull/12358
|
|
https://github.com/ruby/prism/commit/230c8b8a48
|
|
https://github.com/ruby/prism/commit/5ea6042408
|
|
https://github.com/ruby/prism/commit/343197e4ff
|
|
https://github.com/ruby/prism/commit/023e894b74
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11753
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11741
|