From 4a84fa1b39e1bcd8c62b2b5225535dabcdcfdac4 Mon Sep 17 00:00:00 2001 From: Ryan Davis Date: Fri, 12 Dec 2025 13:08:53 -0800 Subject: [PATCH 1/5] [ruby/prism] Define RubyParser::SyntaxError directly and drop require for ruby_parser. Had to add a require of sexp since that came in indirectly via ruby_parser. https://github.com/ruby/prism/commit/df677c324f --- lib/prism/translation/ruby_parser.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/prism/translation/ruby_parser.rb b/lib/prism/translation/ruby_parser.rb index 5149756addefe4..a33ea2306c1967 100644 --- a/lib/prism/translation/ruby_parser.rb +++ b/lib/prism/translation/ruby_parser.rb @@ -2,12 +2,17 @@ # :markup: markdown begin - require "ruby_parser" + require "sexp" rescue LoadError - warn(%q{Error: Unable to load ruby_parser. Add `gem "ruby_parser"` to your Gemfile.}) + warn(%q{Error: Unable to load sexp. Add `gem "sexp"` to your Gemfile.}) exit(1) end +class RubyParser # :nodoc: + class SyntaxError < RuntimeError # :nodoc: + end +end + module Prism module Translation # This module is the entry-point for converting a prism syntax tree into the From ca08351546602cc55f67739fb5c8f616ce8aa94e Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sun, 14 Dec 2025 11:48:23 -0500 Subject: [PATCH 2/5] [ruby/prism] Unreference the block node before destroying it https://github.com/ruby/prism/commit/fc150b1588 --- prism/prism.c | 1 + 1 file changed, 1 insertion(+) diff --git a/prism/prism.c b/prism/prism.c index 7059db8f1d6c49..e10c39bb59f365 100644 --- a/prism/prism.c +++ b/prism/prism.c @@ -18492,6 +18492,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b // yield node. if (arguments.block != NULL) { pm_parser_err_node(parser, arguments.block, PM_ERR_UNEXPECTED_BLOCK_ARGUMENT); + pm_node_unreference(parser, arguments.block); pm_node_destroy(parser, arguments.block); arguments.block = NULL; } From 529b49144eaac5eb8deb5036e459bec9f7940175 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sun, 14 Dec 2025 11:59:05 -0500 Subject: [PATCH 3/5] [ruby/prism] Only set location end when it is larger https://github.com/ruby/prism/commit/65595d6c2c --- prism/prism.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/prism/prism.c b/prism/prism.c index e10c39bb59f365..677e65056f8f74 100644 --- a/prism/prism.c +++ b/prism/prism.c @@ -2075,7 +2075,10 @@ pm_arguments_node_arguments_append(pm_arguments_node_t *node, pm_node_t *argumen node->base.location.start = argument->location.start; } - node->base.location.end = argument->location.end; + if (node->base.location.end < argument->location.end) { + node->base.location.end = argument->location.end; + } + pm_node_list_append(&node->arguments, argument); if (PM_NODE_TYPE_P(argument, PM_SPLAT_NODE)) { From cd27337d0b2141757d19d00e8f6bb86723b843e9 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Sun, 14 Dec 2025 13:31:54 -0500 Subject: [PATCH 4/5] [DOC] Fix backticks in Numeric#floor --- numeric.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/numeric.c b/numeric.c index 1942a6164f616a..813b81b98379bf 100644 --- a/numeric.c +++ b/numeric.c @@ -2601,7 +2601,7 @@ flo_truncate(int argc, VALUE *argv, VALUE num) * floor(ndigits = 0) -> float or integer * * Returns the largest float or integer that is less than or equal to +self+, - * as specified by the given `ndigits`, + * as specified by the given +ndigits+, * which must be an * {integer-convertible object}[rdoc-ref:implicit_conversion.rdoc@Integer-Convertible+Objects]. * From 3e5c4ebe4bab556af2dd5d1ea83fa6d16ac0578b Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Sun, 14 Dec 2025 13:32:27 -0500 Subject: [PATCH 5/5] [DOC] Fix backticks in Numeric#ceil --- numeric.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/numeric.c b/numeric.c index 813b81b98379bf..f96535cd2461d2 100644 --- a/numeric.c +++ b/numeric.c @@ -2621,7 +2621,7 @@ num_floor(int argc, VALUE *argv, VALUE num) * ceil(ndigits = 0) -> float or integer * * Returns the smallest float or integer that is greater than or equal to +self+, - * as specified by the given `ndigits`, + * as specified by the given +ndigits+, * which must be an * {integer-convertible object}[rdoc-ref:implicit_conversion.rdoc@Integer-Convertible+Objects]. *