| Age | Commit message (Collapse) | Author |
|
[Backport #21186]
|
|
It was defined in `arg` only; add that pattern to `command_asgn` as
well.
|
|
[Bug #20989] Ripper: Pass `compile_error`
For the universal parser, `rb_parser_reg_fragment_check` function is
shared between the parser and ripper. However `parser_params` struct
is partially different, and `compile_error` function depends on that
part indirectly.
|
|
Revert "[Bug #20965] Define `it` like an ordinary argument (#12398)"
Reverts ruby/ruby#12398 as per https://bugs.ruby-lang.org/issues/20970#note-6 and https://bugs.ruby-lang.org/issues/20965#note-7.
We need more time to design the intended behavior, and it's too late for Ruby 3.4.
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
|
|
For the universal parser, `rb_reg_named_capture_assign_iter_impl`
function is shared between the parser and ripper. However
`parser_params` struct is partially different, and `assignable`
function depends on that part indirectly.
Notes:
Merged: https://github.com/ruby/ruby/pull/12400
|
|
Also fixes [Bug #20955]
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11781
|
|
How about removing `%require “version”` since it is a definition to specify the minimum version of Bison and is not needed now that we have completely moved to Lrama?
see: https://www.gnu.org/software/bison/manual/html_node/Require-Decl.html
|
|
Introduce inline_primary rule to merge the same BNF pattern
Notes:
Merged: https://github.com/ruby/ruby/pull/11881
Merged-By: nobu <nobu@ruby-lang.org>
|
|
https://bugs.ruby-lang.org/issues/20789
Notes:
Merged: https://github.com/ruby/ruby/pull/11850
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11806
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11805
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11752
|
|
Reject argument forwarding in lambda:
- without parentheses
- after optional argument(s)
Notes:
Merged: https://github.com/ruby/ruby/pull/11751
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11673
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11673
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11716
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11702
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11713
|
|
Since #11698, `parser_str_new` makes `rb_parser_string_t` and `VALUE`
but discards the former, and then `STR_NEW3` makes the same thing
again.
Notes:
Merged: https://github.com/ruby/ruby/pull/11710
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11710
|
|
Changed to use `rb_parser_is_ascii_string` function instead of `is_ascii_string` function
Notes:
Merged: https://github.com/ruby/ruby/pull/11698
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11701
|
|
|
|
The allocated parser string is never freed, which causes a memory leak.
The following code leaks memory:
Ripper.sexp_raw(DATA.read)
__END__
<<~EOF
a
#{1}
a
EOF
Notes:
Merged: https://github.com/ruby/ruby/pull/11669
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11663
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11589
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11661
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11661
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11661
|
|
This change is reduce Ruby C API dependency for Universal Parser.
Reuse dedent_string functions in rb_ruby_ripper_dedent_string functions and remove dependencies on rb_str_modify and rb_str_set_len from the parser.
Notes:
Merged: https://github.com/ruby/ruby/pull/11658
|
|
optimized away
In cases where break/next/redo are not valid syntax, they should
raise a SyntaxError even if inside a conditional block that is
optimized away.
Fixes [Bug #20597]
Co-authored-by: Kevin Newton <kddnewton@gmail.com>
Notes:
Merged: https://github.com/ruby/ruby/pull/11099
Merged-By: jeremyevans <code@jeremyevans.net>
|
|
Fixes [Bug #20720]
Notes:
Merged: https://github.com/ruby/ruby/pull/11565
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11584
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11579
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11553
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11543
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11531
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11530
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11523
|
|
`set_parser_s_value` does nothing in parser therefore no need to
create string object in parser `set_yylval_node`.
# Object allocation
Run `ruby benchmarks/lobsters/benchmark.rb` with the patch
```diff
diff --git a/benchmarks/lobsters/benchmark.rb b/benchmarks/lobsters/benchmark.rb
index 240c50c..6cdd0ac 100644
--- a/benchmarks/lobsters/benchmark.rb
+++ b/benchmarks/lobsters/benchmark.rb
@@ -7,6 +7,8 @@ Dir.chdir __dir__
use_gemfile
require_relative 'config/environment'
+printf "allocated_after_load=%d\n", GC.stat(:total_allocated_objects)
+exit
require_relative "route_generator"
# For an in-mem DB, we need to load all data on every boot
```
## Before
```
ruby 3.4.0dev (2024-08-31T18:30:25Z master d6fc8f3d57) [arm64-darwin21]
...
allocated_after_load=2143519
```
## After
```
ruby 3.4.0dev (2024-09-01T00:40:04Z fix_bugs_20695 d1bae52f75) [arm64-darwin21]
...
allocated_after_load=1579662
```
## Ruby 3.3.0 for reference
```
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin21]
...
allocated_after_load=1732702
```
Notes:
Merged: https://github.com/ruby/ruby/pull/11522
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11451
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11411
|
|
For example, the following code leaks:
class MyRipper < Ripper
def initialize(src, &blk)
super(src)
@blk = blk
end
def warn(msg, *args) = @blk.call(msg)
end
$VERBOSE = true
def call_parse = MyRipper.new("if true\n end\n") { |msg| return msg }.parse
10.times do
500_000.times do
call_parse
end
puts `ps -o rss= -p #{$$}`
end
Before:
37536
53744
70064
86448
102576
119120
135248
151216
167744
183824
After:
19280
19696
19728
20336
20448
21408
21616
21616
21824
21840
Notes:
Merged: https://github.com/ruby/ruby/pull/11289
|
|
For example, the following code leaks:
class MyRipper < Ripper
def initialize(src, &blk)
super(src)
@blk = blk
end
def warn(msg, *args) = @blk.call(msg)
end
$VERBOSE = true
def call_parse = MyRipper.new("if true\n end\n") { |msg| return msg }.parse
10.times do
500_000.times do
call_parse
end
puts `ps -o rss= -p #{$$}`
end
Before:
34832
51952
69760
88048
105344
123040
141152
159152
176656
194272
After:
18400
20256
20272
20272
20272
20304
20368
20368
20368
20400
Notes:
Merged: https://github.com/ruby/ruby/pull/11288
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11294
|
|
For example, the following script leaks:
class MyRipper < Ripper
def initialize(src, &blk)
super(src)
@blk = blk
end
def compile_error(msg) = @blk.call(msg)
end
def call_parse = MyRipper.new("/") { |msg| return msg }.parse
10.times do
100_000.times do
call_parse
end
puts `ps -o rss= -p #{$$}`
end
Before:
93952
169040
244224
318784
394432
468224
544048
618560
693776
768384
After:
19776
19776
20352
20880
20912
21408
21328
21152
21472
20944
Notes:
Merged: https://github.com/ruby/ruby/pull/11287
|
|
Extracrt exception variable into `nd_exc_var` field
to keep the original grammar structure.
For example:
```
begin
rescue Error => e1
end
```
Before:
```
@ NODE_RESBODY (id: 8, line: 2, location: (2,0)-(2,18))
+- nd_args:
| @ NODE_LIST (id: 2, line: 2, location: (2,7)-(2,12))
| +- as.nd_alen: 1
| +- nd_head:
| | @ NODE_CONST (id: 1, line: 2, location: (2,7)-(2,12))
| | +- nd_vid: :Error
| +- nd_next:
| (null node)
+- nd_body:
| @ NODE_BLOCK (id: 6, line: 2, location: (2,13)-(2,18))
| +- nd_head (1):
| | @ NODE_LASGN (id: 3, line: 2, location: (2,13)-(2,18))
| | +- nd_vid: :e1
| | +- nd_value:
| | @ NODE_ERRINFO (id: 5, line: 2, location: (2,13)-(2,18))
| +- nd_head (2):
| @ NODE_BEGIN (id: 4, line: 2, location: (2,18)-(2,18))
| +- nd_body:
| (null node)
+- nd_next:
(null node)
```
After:
```
@ NODE_RESBODY (id: 6, line: 2, location: (2,0)-(2,18))
+- nd_args:
| @ NODE_LIST (id: 2, line: 2, location: (2,7)-(2,12))
| +- as.nd_alen: 1
| +- nd_head:
| | @ NODE_CONST (id: 1, line: 2, location: (2,7)-(2,12))
| | +- nd_vid: :Error
| +- nd_next:
| (null node)
+- nd_exc_var:
| @ NODE_LASGN (id: 3, line: 2, location: (2,13)-(2,18))
| +- nd_vid: :e1
| +- nd_value:
| @ NODE_ERRINFO (id: 5, line: 2, location: (2,13)-(2,18))
+- nd_body:
| @ NODE_BEGIN (id: 4, line: 2, location: (2,18)-(2,18))
| +- nd_body:
| (null node)
+- nd_next:
(null node)
```
Notes:
Merged: https://github.com/ruby/ruby/pull/11243
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11234
|