Sha256: fd26bd43de66760fe53a4d61cedea1dcc1c551b37b9416cbf1e3546af0c4707a

Contents?: true

Size: 207 Bytes

Versions: 7

Compression:

Stored size: 207 Bytes

Contents

rewriter = Fast::Rewriter.new
rewriter.ast = Fast.ast("a = 1")
rewriter.search ='(lvasgn _ ...)'
rewriter.replacement =  -> (node) { replace(node.location.name, 'variable_renamed') }
puts rewriter.rewrite!

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ffast-0.2.2 examples/simple_rewriter.rb
ffast-0.2.0 examples/simple_rewriter.rb
ffast-0.1.9 examples/simple_rewriter.rb
ffast-0.1.8 examples/simple_rewriter.rb
ffast-0.1.7 examples/simple_rewriter.rb
ffast-0.1.6 examples/simple_rewriter.rb
ffast-0.1.5 examples/simple_rewriter.rb