Class: WAG::Instruction::If
Instance Method Summary
collapse
#f32, #f64, #i32, #i64, #local, #memory
Instance Method Details
#result(*types) ⇒ Object
7
8
9
|
# File 'lib/wag/instructions/if.rb', line 7
def result(*types)
@result = WAG::Result.new(*types)
end
|
#then(&block) ⇒ Object
Also known as:
then_
11
12
13
14
15
16
|
# File 'lib/wag/instructions/if.rb', line 11
def then(&block)
instruction = WAG::Then.new
instructions << instruction
instruction.instance_exec(&block) if block
instruction
end
|
#to_sexpr ⇒ Object
19
20
21
22
23
|
# File 'lib/wag/instructions/if.rb', line 19
def to_sexpr
return [name, @result.to_sexpr] if @result
super()
end
|