class Zapata::Primitive::Lvar

Public Instance Methods

node() click to toggle source
# File lib/zapata/primitive/lvar.rb, line 6
def node
  name = @code.to_a.first
  type = @code.type
  OpenStruct.new(type: type, name: name, body: @code)
end
to_raw() click to toggle source
# File lib/zapata/primitive/lvar.rb, line 12
def to_raw
  chosen_value = Predictor::Value.new(node.name, self).choose

  if chosen_value.respond_to?(:node) && chosen_value.node.body == node.body
    Missing.new(node.name).to_raw
  else
    chosen_value.to_raw
  end
end