Sha256: c690d23fa5e085880e45d8abed685b68d9a276e092eb0ca67aeb253b7cbaeaad
Contents?: true
Size: 409 Bytes
Versions: 2
Compression:
Stored size: 409 Bytes
Contents
module Metamorpher module Rewriter module Replacement def replace(path, replacement) if path.empty? replacement.dup else Terms::Literal.new( name: name, children: children.map_at(path.first) { |e| e.replace(path.drop(1), replacement) } ) end end end class ReplacementError < ArgumentError; end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
metamorpher-0.2.6 | lib/metamorpher/rewriter/replacement.rb |
metamorpher-0.2.5 | lib/metamorpher/rewriter/replacement.rb |