Module: CodeMiner::SexpProcessor

Defined in:
lib/codeminer/sexp_processor.rb

Constant Summary collapse

BLACKLIST =
%w(string_embexpr void_stmt)
TOKENS =
%w(int)

Instance Method Summary collapse

Instance Method Details

#to_sexp(exp) ⇒ Object



136
137
138
139
140
141
142
143
# File 'lib/codeminer/sexp_processor.rb', line 136

def to_sexp(exp)
  if exp.respond_to?(:type)
    formatter = formatters.fetch(exp.type, SexpFormatter)
    formatter.new(exp, self).to_sexp
  else
    exp
  end
end

#to_sexp_replace(exp) ⇒ Object



127
128
129
130
131
132
133
134
# File 'lib/codeminer/sexp_processor.rb', line 127

def to_sexp_replace(exp)
  if exp.respond_to?(:type) || exp.kind_of?(Sexp)
    formatter = formatters.fetch(exp.type, SexpFormatter)
    formatter.new(exp, self).to_sexp
  else
    exp
  end
end