diff --git a/CHANGELOG.md b/CHANGELOG.md index b219009b..6634f331 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [3.2.1] - 2022-07-22 + +### Changed + +- [#119](https://github.com/ruby-syntax-tree/syntax_tree/pull/119) - If there are conditionals in the assignment we cannot convert it to the modifier form. There was a bug where it would stop checking for assignment nodes if there were any optional child nodes. + ## [3.2.0] - 2022-07-19 ### Added @@ -306,7 +312,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - 🎉 Initial release! 🎉 -[unreleased]: https://github.com/ruby-syntax-tree/syntax_tree/compare/v3.2.0...HEAD +[unreleased]: https://github.com/ruby-syntax-tree/syntax_tree/compare/v3.2.1...HEAD +[3.2.1]: https://github.com/ruby-syntax-tree/syntax_tree/compare/v3.2.0...v3.2.1 [3.2.0]: https://github.com/ruby-syntax-tree/syntax_tree/compare/v3.1.0...v3.2.0 [3.1.0]: https://github.com/ruby-syntax-tree/syntax_tree/compare/v3.0.1...v3.1.0 [3.0.1]: https://github.com/ruby-syntax-tree/syntax_tree/compare/v3.0.0...v3.0.1 diff --git a/Gemfile.lock b/Gemfile.lock index ab79db80..0fbbbf84 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - syntax_tree (3.2.0) + syntax_tree (3.2.1) prettier_print GEM @@ -19,17 +19,17 @@ GEM rake (13.0.6) regexp_parser (2.5.0) rexml (3.2.5) - rubocop (1.31.2) + rubocop (1.32.0) json (~> 2.3) parallel (~> 1.10) parser (>= 3.1.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.18.0, < 2.0) + rubocop-ast (>= 1.19.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.18.0) + rubocop-ast (1.19.1) parser (>= 3.1.1.0) ruby-progressbar (1.11.0) simplecov (0.21.2) diff --git a/lib/syntax_tree/node.rb b/lib/syntax_tree/node.rb index 58335b00..b633a1c9 100644 --- a/lib/syntax_tree/node.rb +++ b/lib/syntax_tree/node.rb @@ -5173,7 +5173,7 @@ def self.call(parent) while (node = queue.shift) return true if [Assign, MAssign, OpAssign].include?(node.class) - queue += node.child_nodes + queue += node.child_nodes.compact end false diff --git a/lib/syntax_tree/version.rb b/lib/syntax_tree/version.rb index 92f18514..f920098f 100644 --- a/lib/syntax_tree/version.rb +++ b/lib/syntax_tree/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module SyntaxTree - VERSION = "3.2.0" + VERSION = "3.2.1" end diff --git a/test/fixtures/if.rb b/test/fixtures/if.rb index e5e88103..1963d301 100644 --- a/test/fixtures/if.rb +++ b/test/fixtures/if.rb @@ -59,3 +59,7 @@ baz end ) +% +if (x = x + 1).to_i + x +end