Skip to content

Commit

Permalink
Merge pull request #281 from mbj/fix/unary-operator-arguments
Browse files Browse the repository at this point in the history
Fix unary operator with arguments
  • Loading branch information
mbj committed Nov 9, 2021
2 parents f00567b + fb25e0e commit b74601d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
12 changes: 11 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# v0.6.1 unreleased
# v0.6.2 2021-11-09

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

* Fix unary operator with argument.

# v0.6.1 2021-11-08

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

* Fix binary operator with kwargs argument.

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

Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
unparser (0.6.1)
unparser (0.6.2)
diff-lcs (~> 1.3)
parser (>= 3.0.0)

Expand Down
2 changes: 1 addition & 1 deletion lib/unparser/writer/send.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def effective_writer
def effective_writer_class
if details.binary_syntax_allowed?
Binary
elsif details.selector_unary_operator? && n_send?(node)
elsif details.selector_unary_operator? && n_send?(node) && arguments.empty?
Unary
elsif write_as_attribute_assignment?
AttributeAssignment
Expand Down
1 change: 1 addition & 0 deletions test/corpus/literal/send.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,4 @@ def foo
(a + b) / c.-(*f)
x(**foo)
foo&.!
foo.~(b)
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.1'
gem.version = '0.6.2'

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

0 comments on commit b74601d

Please sign in to comment.