Skip to content

Commit

Permalink
Fix hash emitter on kwrestargs
Browse files Browse the repository at this point in the history
  • Loading branch information
mbj committed Oct 8, 2023
1 parent c996bba commit a281ec2
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 5 deletions.
6 changes: 6 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v0.6.8 2023-10-08

[#348](https://github.com/mbj/unparser/pull/348)

* Fix crash on kwrestarg hash member

# v0.6.8 2023-06-14

[#347](https://github.com/mbj/unparser/pull/347)
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
unparser (0.6.8)
unparser (0.6.9)
diff-lcs (~> 1.3)
parser (>= 3.2.0)

Expand All @@ -26,7 +26,7 @@ GEM
mutant (= 0.11.20)
rspec-core (>= 3.8.0, < 4.0.0)
parallel (1.23.0)
parser (3.2.2.3)
parser (3.2.2.4)
ast (~> 2.4.1)
racc
racc (1.7.1)
Expand Down Expand Up @@ -64,7 +64,7 @@ GEM
rubocop-packaging (0.5.2)
rubocop (>= 1.33, < 2.0)
ruby-progressbar (1.13.0)
sorbet-runtime (0.5.10878)
sorbet-runtime (0.5.11064)
unicode-display_width (2.4.2)

PLATFORMS
Expand Down
1 change: 1 addition & 0 deletions config/mutant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ matcher:
- 'Unparser::Emitter::Class#local_variable_scope'
- 'Unparser::Emitter::Def#local_variable_scope'
- 'Unparser::Emitter::FindPattern#dispatch' # 3.0+ specific
- 'Unparser::Emitter::Hash#emit_heredoc_reminder_member' # 3.2+ specific
- 'Unparser::Emitter::HashPattern#write_symbol_body'
- 'Unparser::Emitter::LocalVariableRoot*'
- 'Unparser::Emitter::LocalVariableRoot.included'
Expand Down
2 changes: 1 addition & 1 deletion lib/unparser/emitter/hash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def dispatch
end

def emit_heredoc_reminder_member(node)
emitter(node.children.last).emit_heredoc_reminders
emitter(node.children.last).emit_heredoc_reminders if n_pair?(node)
end

def emit_hash_body
Expand Down
4 changes: 4 additions & 0 deletions test/corpus/literal/since/32.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ def foo(argument, **)
def foo(argument, *)
bar(argument, *)
end

def foo(**)
{ default: 1, ** }
end
2 changes: 1 addition & 1 deletion unparser.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |gem|
gem.name = 'unparser'
gem.version = '0.6.8'
gem.version = '0.6.9'

gem.authors = ['Markus Schirp']
gem.email = 'mbj@schirp-dso.com'
Expand Down

0 comments on commit a281ec2

Please sign in to comment.