From e73c730d8d8bae3918e4c8ee10caebb9cc002e57 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 20 Jul 2026 09:05:18 -0400 Subject: [PATCH 1/5] [ruby/prism] Move deprecated into node_ext https://github.com/ruby/prism/commit/36e88a9aba --- lib/prism/deprecated.rb | 108 ---------------------------------------- lib/prism/node_ext.rb | 102 +++++++++++++++++++++++++++++++++++++ lib/prism/prism.gemspec | 2 - 3 files changed, 102 insertions(+), 110 deletions(-) delete mode 100644 lib/prism/deprecated.rb diff --git a/lib/prism/deprecated.rb b/lib/prism/deprecated.rb deleted file mode 100644 index 332aed76dfacdf..00000000000000 --- a/lib/prism/deprecated.rb +++ /dev/null @@ -1,108 +0,0 @@ -# frozen_string_literal: true -# :markup: markdown -#-- -# rbs_inline: enabled - -module Prism - class InNode < Node - #: () -> String - def in # :nodoc - in_keyword - end - - #: () -> Location - def in_loc # :nodoc - in_keyword_loc - end - - #: () -> String? - def then # :nodoc - then_keyword - end - - #: () -> Location? - def then_loc # :nodoc - then_keyword_loc - end - end - - class MatchPredicateNode < Node - #: () -> String - def operator # :nodoc - keyword - end - - #: () -> Location - def operator_loc # :nodoc - keyword_loc - end - end - - class UnlessNode < Node - #: () -> String - def keyword # :nodoc - unless_keyword - end - - #: () -> Location - def keyword_loc # :nodoc - unless_keyword_loc - end - end - - class UntilNode < Node - #: () -> String - def keyword # :nodoc - until_keyword - end - - #: () -> Location - def keyword_loc # :nodoc - until_keyword_loc - end - - #: () -> String? - def closing # :nodoc - end_keyword - end - - #: () -> Location? - def closing_loc # :nodoc - end_keyword_loc - end - end - - class WhenNode < Node - #: () -> String - def keyword # :nodoc - when_keyword - end - - #: () -> Location - def keyword_loc # :nodoc - when_keyword_loc - end - end - - class WhileNode < Node - #: () -> String - def keyword # :nodoc - while_keyword - end - - #: () -> Location - def keyword_loc # :nodoc - while_keyword_loc - end - - #: () -> String? - def closing # :nodoc - end_keyword - end - - #: () -> Location? - def closing_loc # :nodoc - end_keyword_loc - end - end -end diff --git a/lib/prism/node_ext.rb b/lib/prism/node_ext.rb index 8a6624e76dad77..94aa3bff8ee113 100644 --- a/lib/prism/node_ext.rb +++ b/lib/prism/node_ext.rb @@ -385,4 +385,106 @@ def full_message_loc attribute_write? ? message_loc&.adjoin("=") : message_loc end end + + class InNode < Node + #: () -> String + def in # :nodoc + in_keyword + end + + #: () -> Location + def in_loc # :nodoc + in_keyword_loc + end + + #: () -> String? + def then # :nodoc + then_keyword + end + + #: () -> Location? + def then_loc # :nodoc + then_keyword_loc + end + end + + class MatchPredicateNode < Node + #: () -> String + def operator # :nodoc + keyword + end + + #: () -> Location + def operator_loc # :nodoc + keyword_loc + end + end + + class UnlessNode < Node + #: () -> String + def keyword # :nodoc + unless_keyword + end + + #: () -> Location + def keyword_loc # :nodoc + unless_keyword_loc + end + end + + class UntilNode < Node + #: () -> String + def keyword # :nodoc + until_keyword + end + + #: () -> Location + def keyword_loc # :nodoc + until_keyword_loc + end + + #: () -> String? + def closing # :nodoc + end_keyword + end + + #: () -> Location? + def closing_loc # :nodoc + end_keyword_loc + end + end + + class WhenNode < Node + #: () -> String + def keyword # :nodoc + when_keyword + end + + #: () -> Location + def keyword_loc # :nodoc + when_keyword_loc + end + end + + class WhileNode < Node + #: () -> String + def keyword # :nodoc + while_keyword + end + + #: () -> Location + def keyword_loc # :nodoc + while_keyword_loc + end + + #: () -> String? + def closing # :nodoc + end_keyword + end + + #: () -> Location? + def closing_loc # :nodoc + end_keyword_loc + end + end end diff --git a/lib/prism/prism.gemspec b/lib/prism/prism.gemspec index 709eb83a82ad39..c18d68f4d8a5f9 100644 --- a/lib/prism/prism.gemspec +++ b/lib/prism/prism.gemspec @@ -109,7 +109,6 @@ Gem::Specification.new do |spec| "include/prism/version.h", "lib/prism.rb", "lib/prism/compiler.rb", - "lib/prism/deprecated.rb", "lib/prism/desugar_compiler.rb", "lib/prism/dispatcher.rb", "lib/prism/dot_visitor.rb", @@ -179,7 +178,6 @@ Gem::Specification.new do |spec| "rbi/rubyvm/node_find.rbi", "sig/generated/prism.rbs", "sig/generated/prism/compiler.rbs", - "sig/generated/prism/deprecated.rbs", "sig/generated/prism/desugar_compiler.rbs", "sig/generated/prism/dispatcher.rbs", "sig/generated/prism/dot_visitor.rbs", From 9c7336d82319000a7016538162583f4132fdc726 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 20 Jul 2026 22:26:25 +0900 Subject: [PATCH 2/5] [DOC] Stop documenting undocumented classes --- lib/prism/node_ext.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/prism/node_ext.rb b/lib/prism/node_ext.rb index 94aa3bff8ee113..b22b669d5241d7 100644 --- a/lib/prism/node_ext.rb +++ b/lib/prism/node_ext.rb @@ -386,6 +386,7 @@ def full_message_loc end end + # :stopdoc: class InNode < Node #: () -> String def in # :nodoc @@ -487,4 +488,5 @@ def closing_loc # :nodoc end_keyword_loc end end + # :startdoc: end From da37301f0871f2d2812288ba3570c8e542999606 Mon Sep 17 00:00:00 2001 From: Shugo Maeda Date: Mon, 20 Jul 2026 19:54:25 +0900 Subject: [PATCH 3/5] Keep room in the token buffer for the terminator tokspace stops doubling as soon as the buffer reaches the token's length, so a copy that lands exactly on the end leaves tokfix writing its terminator one byte past it. No caller passes a large enough n to reach that today, but the invariant tokfix relies on is worth holding. Co-Authored-By: Claude Opus 4.8 --- parse.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse.y b/parse.y index a65d689916ba0d..c6973ca6620b0d 100644 --- a/parse.y +++ b/parse.y @@ -7728,7 +7728,7 @@ tokspace(struct parser_params *p, int n) p->tokidx += n; if (p->tokidx >= p->toksiz) { - do {p->toksiz *= 2;} while (p->toksiz < p->tokidx); + do {p->toksiz *= 2;} while (p->toksiz <= p->tokidx); REALLOC_N(p->tokenbuf, char, p->toksiz); } return &p->tokenbuf[p->tokidx-n]; From c048946f29f988523cc23695ac104f74d98fec0e Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 20 Jul 2026 22:46:21 +0900 Subject: [PATCH 4/5] Skip flaky with zjit=dev --- .github/workflows/zjit-ubuntu.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/zjit-ubuntu.yml b/.github/workflows/zjit-ubuntu.yml index 38de755c0862ca..070824e730503e 100644 --- a/.github/workflows/zjit-ubuntu.yml +++ b/.github/workflows/zjit-ubuntu.yml @@ -84,6 +84,7 @@ jobs: run_opts: '--zjit-inline-threshold=0 --zjit-call-threshold=1' specopts: '-T --zjit-inline-threshold=0 -T --zjit-call-threshold=1' configure: '--enable-zjit=dev' + ruby_testopts: '--exclude=ruby/test_hash.rb' # The optimizer benefits from at least 1 iteration of profiling. Also, many # regression tests in bootstraptest/test_yjit.rb assume call-threshold=2. @@ -217,7 +218,7 @@ jobs: ZJIT_BINDGEN_DIFF_OPTS="$ZJIT_BINDGEN_DIFF_OPTS" timeout-minutes: 90 env: - RUBY_TESTOPTS: '-q --tty=no' + RUBY_TESTOPTS: '-q --tty=no ${{ matrix.ruby_testopts }}' EXCLUDES: '../src/test/.excludes-zjit' TEST_BUNDLED_GEMS_ALLOW_FAILURES: '' PRECHECK_BUNDLED_GEMS: 'no' From 0bb123e4de2b9a5f42d2cefef68f251baa82b2c6 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 20 Jul 2026 23:16:06 +0900 Subject: [PATCH 5/5] Pass the option by TESTS --- .github/workflows/zjit-ubuntu.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/zjit-ubuntu.yml b/.github/workflows/zjit-ubuntu.yml index 070824e730503e..31c3c97c507f6f 100644 --- a/.github/workflows/zjit-ubuntu.yml +++ b/.github/workflows/zjit-ubuntu.yml @@ -84,7 +84,7 @@ jobs: run_opts: '--zjit-inline-threshold=0 --zjit-call-threshold=1' specopts: '-T --zjit-inline-threshold=0 -T --zjit-call-threshold=1' configure: '--enable-zjit=dev' - ruby_testopts: '--exclude=ruby/test_hash.rb' + tests: '--exclude=ruby/test_hash.rb' # The optimizer benefits from at least 1 iteration of profiling. Also, many # regression tests in bootstraptest/test_yjit.rb assume call-threshold=2. @@ -218,7 +218,8 @@ jobs: ZJIT_BINDGEN_DIFF_OPTS="$ZJIT_BINDGEN_DIFF_OPTS" timeout-minutes: 90 env: - RUBY_TESTOPTS: '-q --tty=no ${{ matrix.ruby_testopts }}' + RUBY_TESTOPTS: '-q --tty=no' + TESTS: ${{ matrix.tests }} EXCLUDES: '../src/test/.excludes-zjit' TEST_BUNDLED_GEMS_ALLOW_FAILURES: '' PRECHECK_BUNDLED_GEMS: 'no'