Class: Citrus::Unless

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

Instance Method Summary collapse

Instance Method Details

#codegen(g) ⇒ Object



159
160
161
162
163
164
165
166
167
# File 'lib/citrus/nodes.rb', line 159

def codegen(g)
  tb = g.block do |gb|
    expressions.each { |e| e.codegen(gb) }
  end
  fb = g.block do |gb|
    else_expressions.each { |e| e.codegen(gb) }
  end
  g.condition(g.not(condition.codegen(g).last), tb, fb)
end