diff --git a/Changelog.md b/Changelog.md index 40c3336f..c8c127b3 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,10 +1,11 @@ -# v0.5.11 2014-04-07 +# v0.5.11 2014-04-xx Changes: * Fix crash on while and until without body * Better require highjack based zombifier * Do not mutate nthref $1 to gvar $0 +* Use faster duplicate guarding hashing AST::Node intances # v0.5.10 2014-04-06 diff --git a/Gemfile b/Gemfile index 39e6cb41..b9044199 100644 --- a/Gemfile +++ b/Gemfile @@ -3,6 +3,7 @@ source 'https://rubygems.org' gem 'mutant', path: '.' +gem 'morpher', git: 'https://github.com/mbj/morpher' gemspec name: 'mutant' diff --git a/lib/mutant.rb b/lib/mutant.rb index 02459f05..7360cd55 100644 --- a/lib/mutant.rb +++ b/lib/mutant.rb @@ -10,7 +10,6 @@ require 'equalizer' require 'digest/sha1' require 'inflecto' require 'parser' -require 'parser_extensions' require 'parser/current' require 'unparser' require 'ice_nine' diff --git a/lib/parser_extensions.rb b/lib/parser_extensions.rb deleted file mode 100644 index 2c140a8c..00000000 --- a/lib/parser_extensions.rb +++ /dev/null @@ -1,36 +0,0 @@ -# Monkey patch to parser that needs to be pushed upstream -module Parser - # AST namespace - module AST - # The AST nodes we use in mutant - class Node - - # Return hash compatible with #eql? - # - # @return [Fixnum] - # - # @api private - def hash - @type.hash ^ @children.hash ^ self.class.hash - end - - # Test if node is equal to anotheo - # - # @return [true] - # if node represents the same code semantics locations are ignored - # - # @return [false] - # otherwise - # - # @api private - # - def eql?(other) - other.kind_of?(self.class) - other.type.eql?(@type) && other.children.eql?(@children) - end - - end # Node - end # AST -end # Parser - - diff --git a/mutant.gemspec b/mutant.gemspec index bace8dd2..a1255c6f 100644 --- a/mutant.gemspec +++ b/mutant.gemspec @@ -24,6 +24,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = '>= 1.9.3' gem.add_runtime_dependency('parser', '~> 2.1') + gem.add_runtime_dependency('ast', '~> 2.0') gem.add_runtime_dependency('diff-lcs', '~> 1.2') gem.add_runtime_dependency('morpher', '~> 0.2.2') gem.add_runtime_dependency('procto', '~> 0.0.2')