class ReplaceIndirectsWithReferences
Attributes
count_replaced[RW]
Public Class Methods
replace(*args)
click to toggle source
# File src/simplify/replace_indirects_with_references.rb, line 43 def self.replace(*args) self.new.replace(*args) end
Public Instance Methods
replace(input,output)
click to toggle source
# File src/simplify/replace_indirects_with_references.rb, line 49 def replace(input,output) rewriter = ReplaceIndirectsWithReferencesAst.new input.each_line do |line| # Looks to match lines with references if line =~ /:INDIRECT/ ref, ast = line.split("\t") output.puts "#{ref}\t#{rewriter.map(eval(ast)).inspect}" else output.puts line end end @count_replaced = rewriter.count_replaced end