diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c451d287..f6d1009f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: [ruby-3.2, ruby-3.3, ruby-3.4] + ruby: [ruby-3.2, ruby-3.3, ruby-3.4, ruby-4.0] os: [ubuntu-latest] steps: - uses: actions/checkout@v4 @@ -35,7 +35,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: [ruby-3.2, ruby-3.3, ruby-3.4] + ruby: [ruby-3.2, ruby-3.3, ruby-3.4, ruby-4.0] os: [ubuntu-latest] steps: - uses: actions/checkout@v4 @@ -53,7 +53,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: [ruby-3.2, ruby-3.3, ruby-3.4] + ruby: [ruby-3.2, ruby-3.3, ruby-3.4, ruby-4.0] os: [ubuntu-latest] steps: - uses: actions/checkout@v4 @@ -69,7 +69,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: [ruby-3.2, ruby-3.3, ruby-3.4] + ruby: [ruby-3.2, ruby-3.3, ruby-3.4, ruby-4.0] os: [ubuntu-latest] steps: - uses: actions/checkout@v4 @@ -85,7 +85,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: [ruby-3.2, ruby-3.3, ruby-3.4] + ruby: [ruby-3.2, ruby-3.3, ruby-3.4, ruby-4.0] os: [ubuntu-latest] steps: - uses: actions/checkout@v4 diff --git a/Gemfile b/Gemfile index 7f4f5e95..b10e33cd 100644 --- a/Gemfile +++ b/Gemfile @@ -2,4 +2,7 @@ source 'https://rubygems.org' +gem 'mutant', git: 'https://github.com/mbj/mutant' +gem 'mutant-rspec', git: 'https://github.com/mbj/mutant' + gemspec diff --git a/Gemfile.lock b/Gemfile.lock index 615b9a2c..a1229ab1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,18 @@ +GIT + remote: https://github.com/mbj/mutant + revision: a132c7bacbc4f3bd02bbe02d8b64de08d465ac7f + specs: + mutant (0.14.0) + diff-lcs (~> 1.3) + irb (~> 1.15) + parser (~> 3.3.0) + regexp_parser (~> 2.10) + sorbet-runtime (~> 0.6.0) + unparser (~> 0.8.0) + mutant-rspec (0.14.0) + mutant (= 0.14.0) + rspec-core (>= 3.8.0, < 4.0.0) + PATH remote: . specs: @@ -10,51 +25,42 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.3) - date (3.4.1) + date (3.5.1) diff-lcs (1.6.2) - erb (5.0.1) - io-console (0.8.0) - irb (1.15.2) + erb (6.0.1) + io-console (0.8.2) + irb (1.16.0) pp (>= 0.6.0) rdoc (>= 4.0.0) reline (>= 0.4.2) - json (2.12.2) + json (2.18.0) language_server-protocol (3.17.0.5) lint_roller (1.1.0) - mutant (0.13.2) - diff-lcs (~> 1.3) - irb (~> 1.15.2) - parser (~> 3.3.0) - regexp_parser (~> 2.10) - sorbet-runtime (~> 0.5.0) - unparser (~> 0.8.0) - mutant-rspec (0.13.2) - mutant (= 0.13.2) - rspec-core (>= 3.8.0, < 4.0.0) parallel (1.27.0) - parser (3.3.8.0) + parser (3.3.10.0) ast (~> 2.4.1) racc - pp (0.6.2) + pp (0.6.3) prettyprint prettyprint (0.2.0) - prism (1.5.1) - psych (5.2.6) + prism (1.7.0) + psych (5.3.1) date stringio racc (1.8.1) rainbow (3.1.1) - rdoc (6.14.1) + rdoc (7.0.3) erb psych (>= 4.0.0) - regexp_parser (2.10.0) - reline (0.6.1) + tsort + regexp_parser (2.11.3) + reline (0.6.3) io-console (~> 0.5) - rspec (3.13.1) + rspec (3.13.2) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) - rspec-core (3.13.4) + rspec-core (3.13.6) rspec-support (~> 3.13.0) rspec-expectations (3.13.5) diff-lcs (>= 1.2.0, < 2.0) @@ -62,11 +68,11 @@ GEM rspec-its (1.3.1) rspec-core (>= 3.0.0) rspec-expectations (>= 3.0.0) - rspec-mocks (3.13.5) + rspec-mocks (3.13.7) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-support (3.13.4) - rubocop (1.76.2) + rspec-support (3.13.6) + rubocop (1.82.1) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -74,28 +80,29 @@ GEM parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.45.1, < 2.0) + rubocop-ast (>= 1.48.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.45.1) + rubocop-ast (1.49.0) parser (>= 3.3.7.2) - prism (~> 1.4) + prism (~> 1.7) rubocop-packaging (0.6.0) lint_roller (~> 1.1.0) rubocop (>= 1.72.1, < 2.0) ruby-progressbar (1.13.0) - sorbet-runtime (0.5.12194) - stringio (3.1.7) - unicode-display_width (3.1.4) - unicode-emoji (~> 4.0, >= 4.0.4) - unicode-emoji (4.0.4) + sorbet-runtime (0.6.12873) + stringio (3.2.0) + tsort (0.2.0) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.2.0) PLATFORMS x86_64-linux DEPENDENCIES - mutant (~> 0.13.2) - mutant-rspec (~> 0.13.0) + mutant! + mutant-rspec! rspec (~> 3.13) rspec-core (~> 3.13) rspec-its (~> 1.3.0) @@ -104,4 +111,4 @@ DEPENDENCIES unparser! BUNDLED WITH - 2.7.0 + 4.0.3 diff --git a/lib/unparser/ast.rb b/lib/unparser/ast.rb index 2a83d4b9..5e735c1e 100644 --- a/lib/unparser/ast.rb +++ b/lib/unparser/ast.rb @@ -19,6 +19,7 @@ class AST kwoptarg kwrestarg lvasgn + match_var optarg restarg ].to_set.freeze diff --git a/test/corpus/semantic/pattern.rb b/test/corpus/semantic/pattern.rb index 35b7950f..ef8650e8 100644 --- a/test/corpus/semantic/pattern.rb +++ b/test/corpus/semantic/pattern.rb @@ -26,3 +26,7 @@ in %q[a b c $FILE] end a in b, and c +begin + foo => e + e() +end diff --git a/unparser.gemspec b/unparser.gemspec index 3edbc02c..147f63d8 100644 --- a/unparser.gemspec +++ b/unparser.gemspec @@ -29,8 +29,8 @@ Gem::Specification.new do |gem| gem.add_dependency('parser', '>= 3.3.0') gem.add_dependency('prism', '>= 1.5.1') - gem.add_development_dependency('mutant', '~> 0.13.2') - gem.add_development_dependency('mutant-rspec', '~> 0.13.0') + gem.add_development_dependency('mutant', '~> 0.14') + gem.add_development_dependency('mutant-rspec', '~> 0.14') gem.add_development_dependency('rspec', '~> 3.13') gem.add_development_dependency('rspec-core', '~> 3.13') gem.add_development_dependency('rspec-its', '~> 1.3.0')