diff --git a/.github/workflows/zjit-ubuntu.yml b/.github/workflows/zjit-ubuntu.yml index 38de755c0862ca..31c3c97c507f6f 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' + 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,6 +219,7 @@ jobs: timeout-minutes: 90 env: RUBY_TESTOPTS: '-q --tty=no' + TESTS: ${{ matrix.tests }} EXCLUDES: '../src/test/.excludes-zjit' TEST_BUNDLED_GEMS_ALLOW_FAILURES: '' PRECHECK_BUNDLED_GEMS: 'no' 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..b22b669d5241d7 100644 --- a/lib/prism/node_ext.rb +++ b/lib/prism/node_ext.rb @@ -385,4 +385,108 @@ def full_message_loc attribute_write? ? message_loc&.adjoin("=") : message_loc end end + + # :stopdoc: + 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 + # :startdoc: 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", 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];