Class: Citrus::RangeNode

Inherits:
Node
  • Object
show all
Defined in:
lib/citrus/nodes.rb

Instance Method Summary collapse

Instance Method Details

#codegen(g) ⇒ Object



237
238
239
240
241
242
243
244
# File 'lib/citrus/nodes.rb', line 237

def codegen(g)
  fval = first.codegen(g)
  lval = last.codegen(g).last
  unless LLVM::Type(fval) == INT.type && LLVM::Type(lval) == INT.type
    Citrus.error(ArgumentError.new("Bad value for range"))
  end
  g.range(first.codegen(g), last.codegen(g).last, self.full?)
end